Pip不会在virtualenv中安装软件包 [英] Pip won't install packages in virtualenv

查看:168
本文介绍了Pip不会在virtualenv中安装软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天早上执行系统升级后,我无法在任何旧的或全新创建的虚拟环境中安装或更新软件包. 我使用virtualenvwrapper创建虚拟环境.

After performing a system upgrade this morning, I'm not able to install or update packages in any of my old or fresh created virtual environments. I create the virtual environments using virtualenvwrapper.

我尝试重新启动PC,重新创建了所有虚拟环境,但是没有任何效果. 奇怪的是,尽管在站点程序包中找到了pip冻结,但它不会输出我已安装的程序包.

I've tried rebooting my PC, recreating all of my virtual environments, but nothing worked. Strange enough, pip freeze does not output my installed packages, although they are found in sitepackages.

我在具有最新内核的manjaro linux上使用python3.7. 在我的环境和系统中,安装了pip 19.2.3.

Im using python3.7 on manjaro linux with the newest kernel. In my envs and on my system pip 19.2.3 is installed.

我看到的错误如下:

pip install <package>
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

当尝试在不使用virtualenv的情况下使用系统pip时,一切正常.

When trying to use the system pip without virtualenv, everything works just fine.

pip install cython
Requirement already satisfied: cython in /home/manuel/.local/lib/python3.7/site-packages (0.29.13

我希望pip将所需的软件包安装到我的virtualenv的sitepackages文件夹中,而不会告诉我不要使用"--user"安装,无论如何我都不会明确地这样做

I expect pip to install the desired package to the sitepackages folder of my virtualenv without telling me to not use a '--user' install, which I'm not doing explicitly anyway

推荐答案

我自己可以解决此问题. 我在此处 https://pip.pypa.io/zh-CN/中检查了所有pip配置文件最新/用户指南/#configuration

I was able to fix this myself. I checked all the pip config files here https://pip.pypa.io/en/latest/user_guide/#configuration

似乎在pip配置文件/etc/pip.conf中,用户参数设置为true. 将其更改为false可解决我的问题.

Seems like in the pip configuration file /etc/pip.conf the user parameter was set to true. Changing it to false resolved my issue.

我仍然不知道为什么/是否更改了配置文件.

I still don't know why/if the config file changed.

这篇关于Pip不会在virtualenv中安装软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆