User Tools

Site Tools


python3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
python3 [2018/10/06 01:10] – [Debian based distros] dblumepython3 [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 (Start) =====
  
 For Debian (eg., Rasbian) try [[http://www.unixmen.com/howto-install-python-3-x-in-ubuntu-debian-fedora-centos/|the following]] (on raspberry pi libssl-dev isn't available): For Debian (eg., Rasbian) try [[http://www.unixmen.com/howto-install-python-3-x-in-ubuntu-debian-fedora-centos/|the following]] (on raspberry pi libssl-dev isn't available):
Line 37: Line 37:
 </code> </code>
  
-On Raspbian Jessie configure command (below) may have output that looks like this:+==== (Aside) OpenSSL 1.0.1 issue in Raspbian ==== 
 + 
 +On Raspbian Jessie the make command (below) may have output that looks like this:
  
 <code> <code>
Line 57: Line 59:
  
 <code> <code>
-ssh -V +openssl version 
-OpenSSH_6.7p1 Raspbian-5+deb8u7, OpenSSL 1.0.1t  3 May 2016+OpenSSL 1.0.1t  3 May 2016
 </code> </code>
  
Line 65: Line 67:
 <code bash> <code bash>
 # Add the backport apt source. # Add the backport apt source.
-echo "deb-src http://httpredir.debian.org/debian jessie-backports main contrib non-free" | sudo tee /etc/apt/sources.list.d/jessie-backports.list+echo "deb-src http://httpredir.debian.org/debian jessie-backports main contrib non-free"
 +      sudo tee /etc/apt/sources.list.d/jessie-backports.list
 sudo apt update sudo apt update
  
Line 79: Line 82:
 </code> </code>
  
-Then, back to Python3, on Raspbian, I put it in the default location:+**Update**: The following apt-cache policy command showed the old libssl was still installed. It's probably bad, but I [[https://my-take-on.tk/2018/09/10/installing-latest-python-3x-and-pip-on-any-debian-based-system/|installed the new one with apt install -t jessie-backports]]. 
 + 
 +<code> 
 +sudo apt-cache policy libssl-dev 
 +</code> 
 + 
 +===== Debian based distros (Continued) ===== 
 + 
 +Then, back to Python3, on Raspbian, I put it in the default location, /usr/local:
  
 <code bash> <code bash>
 +screen  # Because using optimizations will take hours
 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 != "screen" ]] || exit  # exit if in screen session
 </code> </code>
  
 ===== Modules ===== ===== Modules =====
  
-Sometimes I have trouble with pip3 (ImportError: cannot import name 'main' from 'pip'), so prefer to use "python 3 -m pip" instead.+Sometimes I have trouble with pip3 (ImportError: cannot import name 'main' from 'pip'), so prefer to use "python3 -m pip" instead.
  
 <code bash> <code bash>
Line 108: Line 121:
 sudo python3 -m pip install --no-deps git+https://github.com/snowch/thrift_sasl sudo python3 -m pip install --no-deps git+https://github.com/snowch/thrift_sasl
 # sudo python3 -m pip install thriftpy # sudo python3 -m pip install thriftpy
 +</code>
 +
 +===== MatPlotLib =====
 +
 +There's another note on MatPlotLib over at my [[wsl]] page. For the first time on a Macintosh, I had to set the MatPlotLib backend to 'MacOSX'. Otherwise the plot window would appear but not draw any lines.
 +
 +<code python>
 +import matplotlib
 +matplotlib.use('MacOSX')
 </code> </code>
python3.1538813441.txt.gz · Last modified: 2023/04/12 20:44 (external edit)