简体   繁体   English

如何在Ubuntu 16.04 LTS中安装pip3和paramiko?

[英]How to install pip3 and paramiko in ubuntu 16.04 LTS?

I am trying to install python paramiko using below command: 我正在尝试使用以下命令安装python paramiko

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: 然后尝试使用上述命令安装pip ,结果是:

Reading package lists... Done Building dependency tree 正在读取包列表...完成构建依赖关系树
Reading state information... Done python3-pip is already the newest version (8.1.1-2ubuntu0.4). 正在读取状态信息...完成的python3-pip已经是最新版本(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. 以下软件包是自动安装的,不再需要: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使用'sudo apt autoremove'删除它们。 0 upgraded, 0 newly installed, 0 to remove and 82 not upgraded. 0已升级,0新安装,0已删除和82未升级。

Then I tried to install paramiko again but getting the same error, pip is not installed. 然后,我尝试再次安装paramiko ,但收到相同的错误,未安装pip

When I type pip3 --version the output is: 当我输入pip3 --version ,输出为:

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. 我不知道为什么,但是在我的情况下,python -m pip等...比仅pip等要好。

if you really don't have pip (but I thought it comes automatically with python now) you can also get it using: 如果您真的没有pip(但是我认为它现在是python自动提供的),您也可以使用以下命令获取它:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py (from here ) 卷曲https://bootstrap.pypa.io/get-pip.py -o get-pip.py(从这里开始

it works on my computer, I don't know why sudo apt-get would not work but you can try this solution instead. 它可以在我的计算机上工作,我不知道为什么sudo apt-get无法工作,但是您可以尝试使用此解决方案。

For pip on python 3 you have to enter the following command: 对于python 3上的pip,您必须输入以下命令:

sudo apt install python3-pip

Hope this helps 希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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