Yannik_Sc
Yannik_Sc

Reputation: 23

Install Python 3.5 with pip on Debian 8

so, my question is very simple, how can I install Python 3.5 with pip on Debian 8, without getting errors like ImportError: cannot import name 'HTTPSHandler'?

Upvotes: 2

Views: 8313

Answers (1)

Ben
Ben

Reputation: 6348

By far the easiest way I've found to install Python (though I haven't tried Debian 8) on Linux is to use the python distribution Miniconda.

# Assuming you want 64bit
cd ~
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda-latest-Linux-x86_64.sh
# Agree to the license agreement and where to put it
# Add it to your $PATH
# Assuming you use bash (You might have to change this if my memory isn't correct...)
echo 'export PATH="~/miniconda3/bin:$PATH"' >> ~/.bashrc
# reload your .bashrc
source ~/.bashrc
# make sure it works
python --version # should print out 3.5
# install something with pip
pip install pyperclip # or anything
# make sure it works
python -c 'import pyperclip'

Now you can use pip. However, for complicated binary packages like numpy, etc., Miniconda also comes with a tool called conda. conda --help or google should get you started down that route if you need it.

If you ever need to uninstall Miniconda, just erase ~/miniconda3 and remove the PATH line mentioned above from your ~/.bashrc

Also, if you have the room and you want a lot of pre-installed packages that 'just work', they also put out Anaconda python.

If you aren't used the terminal, Anaconda comes with a decent IDE, Spyder, which can by started by typing spyder from the terminal.

Upvotes: 2

Related Questions