Questions tagged «pip»

有关使用pip(Python的软件包安装程序)的问题。

3
apt-get安装vs pip安装
对于下载python软件包时必须使用上述命令的情况,我有些困惑。我试图根据这个问题的答案下载名为pyudev的软件包。我执行了以下命令: sudo pip install python-pyudev 但收到以下消息: Downloading/unpacking python-pyudev Could not find any downloads that satisfy the requirement python-pyudev Cleaning up... No distributions at all found for python-pyudev Storing complete log in /home/vineet/.pip/pip.log 但是以下工作正常: sudo apt-get install python-pyudev 什么时候apt-get应该用来安装软件包python-pip?什么时候应该使用?

3
使用代理在ubuntu 16.04 LTS上安装pip3(用于python3)
我尝试输入: sudo apt install python3-pip 我得到的错误是: $ sudo apt install python3-pip Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libexpat1-dev libpython3-dev libpython3.5-dev python-pip-whl python3-dev python3-wheel python3.5-dev The following NEW packages will be installed: libexpat1-dev libpython3-dev libpython3.5-dev python-pip-whl python3-dev python3-pip python3-wheel …

6
如何检测和删除通过pip安装的Python软件包?
我不小心使用pip而不是将Python软件包安装到了系统中apt-get。我这样做有两种方式: 使用较旧版本的virtualenv时,我忘了--no-site-packages在创建virtualenv时附加-之后,当我调用时pip install,Python软件包将安装到系统而不是virtualenv 在正确设置的virtualenv中,我键入了sudo pip install somepackage-安装到系统而不是virtualenv的sudo 我碰巧注意到了这一点,因为我pip freeze在virtualenv之外键入了内容,并发现了一些不应该在那里列出的Python软件包。所以现在我的问题是: 如何识别系统上已错误安装的所有Python软件包(即,出现在pip freeze列表中但未安装的Python软件包apt-get)? 如何删除它们?

7
Pip无法正常工作:ImportError:没有名为“ pip._internal”的模块
运行结果pip或pip3结果: Traceback (most recent call last): File "/home/myuser/.local/bin/pip", line 7, in <module> from pip._internal import main ImportError: No module named 'pip._internal' 我对此有疑问,并卸载了pip3,但是当我尝试再次使用进行安装时, sudo apt-get -y install python3-pip 它确实安装,但然后运行pip或pip3我得到相同的错误。 #which pip3 /home/myuser/.local/bin/pip3
62 python  pip 

3
“严重错误:openssl / opensslv.h:没有这样的文件或目录”,编译mitmproxy
我正在尝试通过pip安装mitmproxy软件包,如下所示: $ sudo pip install mitmproxy 它以以下错误消息终止: x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o build/temp.linux-x86_64-2.7/_openssl.c:391:30: fatal error: openssl/opensslv.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Can't roll back …
52 compiling  gcc  pip 

6
如何将pip升级到最新?
我安装了pip get-pip.py之后pip freeze抛出以下错误 Exception: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main status = self.run(options, args) File "/usr/lib/python2.7/dist-packages/pip/commands/freeze.py", line 74, in run req = pip.FrozenRequirement.from_dist(dist, dependency_links, find_tags=find_tags) File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 299, in from_dist assert len(specs) == 1 and specs[0][0] == '==' AssertionError Storing debug log for failure …
51 upgrade  python  pip 

3
使用pip在virtualenv中安装scrapy时出错
pip install scrapy Downloading/unpacking scrapy Downloading Scrapy-0.24.2-py2-none-any.whl (502kB): 502kB downloaded Downloading/unpacking pyOpenSSL (from scrapy) Downloading pyOpenSSL-0.14.tar.gz (128kB): 128kB downloaded Running setup.py (path:/home/elie/.virtualenvs/stat/build/pyOpenSSL/setup.py) egg_info for package pyOpenSSL warning: no previously-included files matching '*.pyc' found anywhere in distribution no previously-included directories found matching 'doc/_build' Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 …

2
如何在Ubuntu 16.10上为Python 3.6安装pip?
首先,我想指出这个问题似乎是重复的,但事实并非如此。我在Ask Ubuntu上看到的所有问题都是关于Python 3的pip,而我正在谈论的是Python 3.6。那时使用的步骤不适用于Python 3.6。 我从官方docker商店获得了清晰的Ubuntu 16.10映像。 跑 apt-get update 跑 apt-get install python3.6 跑 apt-get install python3-pip 跑 pip3 install requests bs4 跑 python3.6 script.py 得到ModuleNotFoundError如下: Traceback (most recent call last): File "script.py", line 6, in <module> import requests ModuleNotFoundError: No module named 'requests' 我在机器中有Python和pip: python3 python3.5 python3.5m python3.6 …

6
sudo pip install仍然是一种坏习惯吗?
我是Ubuntu的新手,所以请多多包涵。我pip使用以下命令进行安装:sudo apt-get -y install python-pip。然后我安装NLTK使用他们的网站上,这是命令:sudo pip install -U nltk。但是后来我偶然发现了这个问题,说我所做的一切都是“断法”。最令我震惊的是,使用sudo pip是天生的错误,pip用力太大可能会损坏操作系统文件。谁能验证这个说法? 注意-我sudo之所以使用,是因为尝试命令apt-get -y install python-pip时出现了2个错误: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

2
sudo apt-get install python-pip失败
sudo apt-get install python-pip Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python-pip 如何在ubuntu:14.04中安装python-pip?
34 14.04  python  pip 

7
使用sudo运行pip时,“ pip:命令未找到”但已安装
sudo easy_install pip Searching for pip Best match: pip 1.4.1 Processing pip-1.4.1-py2.7.egg pip 1.4.1 is already the active version in easy-install.pth Installing pip script to /home/nyzlfc/.local/bin Installing pip-2.7 script to /home/nyzlfc/.local/bin Using /home/nyzlfc/.local/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg Processing dependencies for pip Finished processing dependencies for pip 然后当我跑步时 sudo pip install -U pyyaml nltk 我得到: …

4
如何安装pydot和graphviz?
我正在运行需要pydot和graphviz的代码。我正在使用python 3.5和ubuntu 16.04 LTS 64位。 File "/usr/local/lib/python3.5/dist-packages/keras/utils/vis_utils.py", line 17, in _check_pydot raise ImportError('Failed to import pydot. You must install pydot' ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work. 我在Google上搜索了一下,然后发现可以使用代码安装pydot pip install pydot。但我知道会收到此错误。我是Ubuntu的菜鸟,我不知道该怎么办。那我该如何安装pydot? deeplearning@deep-learning-virtual-machine:~$ pip install pydot Collecting pydot Collecting pyparsing>=2.1.4 (from pydot) Using …
24 16.04  python3  pip 


10
运行Pip3 ImportError:无法导入名称'main'
我想安装Scipy(已经安装了Numpy)。我已经在OS和IDLE3(3.5.2)中安装了Python 3.5.1-3。当我在终端上打 sudo pip3 install scipy 打印出来 Traceback (most recent call last): File "/usr/bin/pip3", line 9, in <module> from pip import main ImportError: cannot import name 'main' 我已经尝试过重新安装pip3并重新启动OS,但是它没有改变。pip3和其他人一起工作很奇怪吗?
21 python3  pip 

4
我已经安装了Ubuntu提供的pip时,如何安装最新版本的pip?
在Ubuntu 16.04中,当您执行以下操作时: pip install --upgrade pip 你得到: Collecting pip Using cached pip-8.1.2-py2.py3-none-any.whl Installing collected packages: pip Successfully installed pip-8.1.1 You are using pip version 8.1.1, however version 8.1.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command. 很公平。现在尝试 pip install --upgrade pip 你会得到: Collecting pip Using …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.