简体   繁体   English

在Ubuntu中安装Python Pip

[英]Python pip installation in ubuntu

I am new to Ubuntu and was trying to install pip using get-pip.py , when I received this message. 我刚接触Ubuntu,并在收到此消息时尝试使用get-pip.py安装pip。

Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-    packages/pip-8.1.2-py2.7.egg

But when I enter pip -V , I receive an error saying : 但是当我输入pip -V ,我收到一条错误消息:

The 'pip==7.1.0' distribution was not found and is required by the application

Complete error 完成错误

I was trying to install new packages using pip install <packagename> but this command gives the same error as previous . 我试图使用pip install <packagename>安装新软件包,但是此命令给出了与上一个相同的错误。

I suggest installing pip using the package manager. 我建议使用软件包管理器安装pip。 Open up a terminal and enter 打开一个终端并输入

sudo apt-get install python-pip

That should install the pip ubunutu package. 应该安装pip ubunutu软件包。

You should not be installing pip for the default python installation, neither from the package manager nor using get-pip.py . 无论是从软件包管理器还是使用get-pip.py ,都不应为默认的python安装安装pip。 So you can never use it to break the system python. 因此,您永远不能使用它来破坏系统python。

Instead always use virtualenv (created from the default/system python or from a newer version), activate and use pip in that environment. 而是始终使用virtualenv (从默认/系统python或从较新版本创建),在该环境中激活并使用pip

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

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