python3
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
python3 [2018/10/05 23:03] – [Modules] dblume | python3 [2023/04/14 20:37] (current) – dblume | ||
---|---|---|---|
Line 29: | Line 29: | ||
For **OS X**, brew upgrading httpie seems to upgrade to the latest Python 3, so I didn't have to do stuff. | For **OS X**, brew upgrading httpie seems to upgrade to the latest Python 3, so I didn't have to do stuff. | ||
- | ===== Debian based distros ===== | + | ===== Debian based distros |
For Debian (eg., Rasbian) try [[http:// | For Debian (eg., Rasbian) try [[http:// | ||
Line 36: | Line 36: | ||
sudo apt-get install build-essential libncursesw5-dev libreadline-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev libffi-dev | sudo apt-get install build-essential libncursesw5-dev libreadline-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev libffi-dev | ||
</ | </ | ||
+ | |||
+ | ==== (Aside) OpenSSL 1.0.1 issue in Raspbian ==== | ||
+ | |||
+ | On Raspbian Jessie the make command (below) may have output that looks like this: | ||
< | < | ||
Line 42: | Line 46: | ||
</ | </ | ||
- | On Raspbian, I put it in the default location: | + | On Raspbian, the pip module may not work because it relies on the ssl module. |
+ | |||
+ | < | ||
+ | pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. | ||
+ | </ | ||
+ | |||
+ | Python' | ||
+ | |||
+ | > Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host(). | ||
+ | |||
+ | If you check the version of ssh: | ||
+ | |||
+ | < | ||
+ | $ openssl version | ||
+ | OpenSSL 1.0.1t | ||
+ | </ | ||
+ | |||
+ | That OpenSSL is too old. So you may have to [[https:// | ||
+ | |||
+ | <code bash> | ||
+ | # Add the backport apt source. | ||
+ | echo " | ||
+ | sudo tee / | ||
+ | sudo apt update | ||
+ | |||
+ | # Get the openssl source | ||
+ | apt-get source openssl/ | ||
+ | |||
+ | # Make and install it. | ||
+ | cd openssl-1.0.2k/ | ||
+ | ./config --prefix=/ | ||
+ | make | ||
+ | make test | ||
+ | sudo make install | ||
+ | </ | ||
+ | |||
+ | **Update**: The following apt-cache policy command showed the old libssl was still installed. It's probably bad, but I [[https:// | ||
+ | |||
+ | < | ||
+ | sudo apt-cache policy libssl-dev | ||
+ | </ | ||
+ | |||
+ | ===== Debian based distros (Continued) ===== | ||
+ | |||
+ | Then, back to Python3, on Raspbian, I put it in the default location, /usr/local: | ||
<code bash> | <code bash> | ||
+ | screen | ||
cd Python-3.7.0/ | cd Python-3.7.0/ | ||
./configure --enable-optimizations | ./configure --enable-optimizations | ||
make -j4 | make -j4 | ||
sudo make install | sudo make install | ||
+ | [[ $TERM != " | ||
</ | </ | ||
===== Modules ===== | ===== Modules ===== | ||
- | Sometimes I have trouble with pip3 (ImportError: | + | Sometimes I have trouble with pip3 (ImportError: |
<code bash> | <code bash> | ||
Line 71: | Line 121: | ||
sudo python3 -m pip install --no-deps git+https:// | sudo python3 -m pip install --no-deps git+https:// | ||
# sudo python3 -m pip install thriftpy | # sudo python3 -m pip install thriftpy | ||
+ | </ | ||
+ | |||
+ | ===== MatPlotLib ===== | ||
+ | |||
+ | There' | ||
+ | |||
+ | <code python> | ||
+ | import matplotlib | ||
+ | matplotlib.use(' | ||
</ | </ |
python3.1538805804.txt.gz · Last modified: 2023/04/12 20:44 (external edit)