From cd6d11c1ef0835902edd13e9de9dc583efbcb131 Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Fri, 28 Feb 2020 15:01:04 -0500 Subject: [PATCH] make setup.py pre-requisites instructions consistent --- docs/setup.htm | 159 ++++++++++++++++++++++--------------------------- 1 file changed, 72 insertions(+), 87 deletions(-) diff --git a/docs/setup.htm b/docs/setup.htm index ccd904e5..247b2664 100644 --- a/docs/setup.htm +++ b/docs/setup.htm @@ -112,21 +112,21 @@ Python 2.7.15rc1
-
# For systems that do not have Python 2 pre-installed (for example,
-# Ubuntu 18.04 and later):
+            
+sudo apt-get update
+
+# For systems that do not have Python2 pre-installed
+# (for example, Ubuntu 18.04 and later):
 sudo apt-get install python
 
-# You may have to install the Python Imaging Library.
-# Try this first:
-sudo apt-get install python-pil
-# If that doesn't work, try this:
+# Required packages:
+sudo apt-get install python-configobj
+sudo apt-get install python-cheetah
+sudo apt-get install python-pil
+# If python-pil does not work, try this:
 sudo apt-get install python-imaging
 
-# Other required packages:
-sudo apt-get install python-configobj
-sudo apt-get install python-cheetah
-
-# Required if hardware is serial or USB, respectively:
+# Required if hardware is serial or USB:
 sudo apt-get install python-serial
 sudo apt-get install python-usb
 
@@ -137,28 +137,30 @@ sudo apt-get install python-mysqldb
 # Required if using FTP on Raspbian systems:
 sudo apt-get install ftp
 
-# Optional. For extended almanac information, install "ephem".
-# Try this first:
+# Optional: for extended almanac information:
 sudo apt-get install python-ephem
-# If that doesn't work, try this:
+# If that does not work, try this:
 sudo apt-get install python-dev
 sudo apt-get install python-pip
 sudo pip install pyephem
-
# Required packages:
+            
+sudo apt-get update
+
+# Required packages:
 sudo apt-get install python3-pil
 sudo apt-get install python3-configobj
-sudo apt-get install python3-distutils
-
-# Not all distributions have ported Cheetah to Python 3. Try this first:
-sudo apt-get install python3-cheetah
-# If that doesn't work, try this:
+sudo apt-get install python3-distutils
+sudo apt-get install python3-cheetah
+# If python3-cheetah does not work, try this:
+sudo apt-get install python3-cheetah3
+# If python3-cheetah3 does not work, try this:
 sudo apt-get install python3-pip
 sudo apt-get install python3-dev
 sudo pip3 install cheetah3
 
-# Required if hardware is serial or USB, respectively:
+# Required if hardware is serial or USB:
 sudo apt-get install python3-serial
 sudo apt-get install python3-usb
 
@@ -166,14 +168,12 @@ sudo apt-get install python3-usb
 sudo apt-get install mysql-client
 sudo apt-get install python3-mysqldb
 
-# Optional. For extended almanac information, install "ephem".
-# Not all distributions have ported it to Python 3. Try this first:
+# Optional: for extended almanac information:
 sudo apt-get install python3-ephem
-# If that doesn't work, try this:
+# If that does not work, try this:
 sudo apt-get install python3-pip
 sudo apt-get install python3-dev
-sudo pip3 install pyephem
-    
+sudo pip3 install pyephem
@@ -186,7 +186,10 @@ sudo pip3 install pyephem
-
# Required packages:
+                
# For systems based on RHEL 7 and earlier:
+sudo yum update
+
+# Required packages:
 sudo yum install python-configobj
 sudo yum install python-cheetah
 sudo yum install python-imaging
@@ -200,32 +203,30 @@ sudo easy_install pyusb
 sudo yum install mysql-client
 sudo yum install python-mysqldb
 
-# Optional for extended almanac information:
-sudo yum install pyephem
-                
+# Optional: for extended almanac information: +sudo yum install pyephem
-
# For RHEL 8 based systems.
+            
# For systems based on RHEL 8 and later:
+sudo yum update
 
-# You may have to install Python 3:
-sudo yum update
-sudo yum install python3
+# Ensure that Python3 is installed:
+sudo yum install python3
 
-# Then install pre-requisites:
+# Required packages:
 sudo yum install python3-configobj
 sudo yum install python3-pillow
-sudo yum install python3-pyserial
+sudo pip3 install Cheetah3
+
+# Required if hardware is serial or USB:
+sudo yum install python3-pyserial
 sudo yum install python3-pyusb
 
-# As of this writing, Cheetah can only be installed using pip3:
-sudo pip3 install Cheetah3
-
-# For extended almanac information (optional)
-sudo pip3 install pyephem
-
-# If you plan on using MySQL
+# Required if using MySQL:
 sudo yum install python3-PyMySQL
-
+ +# Optional: for extended almanac information +sudo pip3 install pyephem
@@ -239,23 +240,23 @@ sudo yum install python3-pyusb
# Tested on openSUSE Leap 15.1
 
-# You may have to install python 2 first:
+# Ensure that Python2 is installed:
 sudo zypper install python
 
 # Required packages:
 sudo zypper install python2-configobj
 sudo zypper install python2-Pillow
-sudo zypper install python2-pyserial
-sudo zypper install python2-usb
-
-# Cheetah must be installed by using pip2:
-sudo zypper install python2-pip
+sudo zypper install python2-pip
 sudo pip2 install Cheetah
 
-# If you plan on using MySQL / MariaDB:
+# Required if hardware is serial or USB:
+sudo zypper install python2-pyserial
+sudo zypper install python2-usb
+
+# Required if using MySQL / MariaDB:
 sudo zypper install python2-mysqlclient
 
-# For extended almanac information (optional):
+# Optional: for extended almanac information:
 sudo pip2 install pyephem
@@ -268,10 +269,10 @@ sudo zypper install python3-Cheetah3 sudo zypper install python3-pyserial sudo zypper install python3-usb -# If you plan on using MySQL / MariaDB: +# Required if using MySQL / MariaDB: sudo zypper install python3-mysqlclient -# For extended almanac information (optional) +# Optional: for extended almanac information: sudo pip3 install pyephem
@@ -285,39 +286,37 @@ sudo zypper install python3-usb
-
sudo pip install configobj
+                
# Required packages:
+sudo pip install configobj
 sudo pip install cheetah
-sudo pip install pillow
-sudo pip install MySQL-python
+sudo pip install pillow
 
-# Required if hardware is serial or USB, respectively:
+# Required if hardware is serial or USB:
 sudo pip install pyserial
 sudo pip install pyusb
 
-# Optional for extended almanac information:
-sudo pip install pyephem
-
+# Required if using MySQL: +sudo pip install MySQL-python + +# Optional: for extended almanac information: +sudo pip install pyephem
-
# Install pip3 if it has not already been installed:
-sudo apt-get install python3-pip
-
-# Then the prerequisites:
+                
# Required packages:
 sudo pip3 install configobj
 sudo pip3 install cheetah3
 sudo pip3 install Pillow-PIL
 
-# Required if you are planning on using MySQL. If this does not
-# install cleanly, then see https://pypi.org/project/mysqlclient/
-sudo pip3 install mysqlclient
-
 # Required if hardware is serial or USB, respectively:
 sudo pip3 install pyserial
 sudo pip3 install pyusb
 
-# Optional for extended almanac information:
-sudo pip3 install pyephem
-                
+# Required if using MySQL. If this does not +# install cleanly, then see https://pypi.org/project/mysqlclient/ +sudo pip3 install mysqlclient + +# Optional: for extended almanac information: +sudo pip3 install pyephem
@@ -338,23 +337,9 @@ sudo pip3 install pyusb sudo python3 ./setup.py install

- This example uses python3 to install WeeWX. + This example uses Python3 to install WeeWX. For Python2 use python2 or python.

-

Note that whatever version of Python you use to invoke - setup.py will be injected into the "shebang" at the top of all - executables, making it the default Python used to run the executable. -

-

- For example, after the above, the top of the executable weewxd, - will look like: -

-
#!/usr/bin/python3
-#
-#    Copyright (c) 2009-2019 Tom Keffer 
-...
-
-

Run

Run the main program directly: