Ubuntu: How to install pip for Python 3.6 on Ubuntu 16.10?



Question:

I'd like to start pointing out that this question may seem like a duplicate, but it isn't. All the questions I saw here on Ask Ubuntu were regarding pip for Python 3 and I'm talking about Python 3.6. The steps used back then don't work for Python 3.6.

  1. I got a clear Ubuntu 16.10 image from the official docker store.
  2. Run apt-get update
  3. Run apt-get install python3.6
  4. Run apt-get install python3-pip
  5. Run pip3 install requests bs4
  6. Run python3.6 script.py
  7. Got ModuleNotFoundError below:
Traceback (most recent call last):                                                                                                               File "script.py", line 6, in <module>                                                                                                  import requests                                                                                                                           ModuleNotFoundError: No module named 'requests'  

Python's and pip's I have in the machine:

python3            python3.5          python3.5m         python3.6          python3m                                                          python3-config     python3.5-config   python3.5m-config  python3.6m         python3m-config        pip     pip3    pip3.5     


Solution:1

I got an answer on stackoverflow.

Source: https://stackoverflow.com/a/44254088/1812319


Solution:2

Why not wget the get-pip.py script and then install PyPI by running that script with your Python3.6 executable?


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »