简体   繁体   中英

How to install pip3 and paramiko in ubuntu 16.04 LTS?

I am trying to install python paramiko using below command:

pip3 install paramiko

then I got an error:

The program 'pip3' is currently not installed. You can install it by typing:
sudo apt install python3-pip

then tried to install pip using above command, the result is:

Reading package lists... Done Building dependency tree
Reading state information... Done python3-pip is already the newest version (8.1.1-2ubuntu0.4). The following packages were automatically installed and are no longer required: python3-babel python3-dateutil python3-decorator python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-mock python3-ofxparse python3-passlib python3-pbr python3-psutil python3-psycopg2 python3-pydot python3-pyinotify python3-pypdf2 python3-serial python3-stdnum python3-tz python3-usb python3-vatnumber python3-werkzeug python3-yaml Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 82 not upgraded.

Then I tried to install paramiko again but getting the same error, pip is not installed.

When I type pip3 --version the output is:

The program 'pip3' is currently not installed. You can install it by typing:
sudo apt install python3-pip


pip --version

Output is:

 pip 10.0.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

How can I resolve this?

I usually do:

sudo python3 -m pip install paramiko

or

python3 -m pip --version

instead of

pip3 install

I don't know why but python -m pip etc ... works better than just pip etc... in my case.

if you really don't have pip (but I thought it comes automatically with python now) you can also get it using:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py (from here )

it works on my computer, I don't know why sudo apt-get would not work but you can try this solution instead.

For pip on python 3 you have to enter the following command:

sudo apt install python3-pip

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM