- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我想我在 Mac 上使用 Python 和/或 pip 时遇到了一些问题。我在全局范围内安装了 Python 2.7,然后我通常设置 virtualenvs 并安装 Python3.6.4,但在最后一天左右,我遇到了 Fabric 和 SSH2 等软件包的问题,我无法安装它们并出现各种错误或当我尝试导入包时它会抛出 Fabric。
我现在正在尝试删除 Fabric 并安装 Fabric3 及其抛出的错误,如下所示:
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Users/david/Documents/projects/uptimeapp/env/lib/python3.6/site-packages/Fabric3-1.14.post1.dist-info'
Consider using the `--user` option or check the permissions.
(env) Davids-MacBook-Air:uptimeapp david$ pip install fabric3 --user
Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
如果我执行 sudo pip install fabric
然后它安装但有这个警告:
The directory '/Users/david/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/david/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
但我认为不建议使用 sudo 进行 pip 安装?
这些是我尝试 pip install ssh2-python
时遇到的错误
ssh2/agent.c:569:10: fatal error: 'libssh2.h' file not found
#include "libssh2.h"
^~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/Users/david/Documents/projects/uptimeapp/env/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/bl/97vt48j97zd2sj05zmt4xst00000gn/T /pip-install-mpyq41q4/ssh2-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/bl/97vt48j97zd2sj05zmt4xst00000gn/T/pip-record-qul_k3kq/install-record.txt --single-version-externally-managed --compile - -install-headers /Users/david/Documents/projects/uptimeapp/env/bin/../include/site/python3.6 /ssh2-python" failed with error code 1 in /private/var/folders/bl/97vt48j97zd2sj05zmt4xst00000gn/T/pip-install-mpyq41q4/ssh2-python/
我已经设法删除 Fabric 并使用 sudo 命令安装 Fabric3,但我宁愿不这样做。
我应该补充一 pip ,我在 Python2.7 或 envs 中全局安装其他包时没有遇到任何其他问题。
最佳答案
出现 permission denied
错误是因为您已经通过使用 sudo
安装虚拟环境。运行
$ sudo chown -R david:staff /Users/david/Documents/projects/uptimeapp/env
修复权限。如果您有其他权限问题,也许修复整个主目录的权限甚至是明智的:
$ sudo chown -R david:staff /Users/david/
现在重新安装包应该可以再次工作了:
$ source /Users/david/Documents/projects/uptimeapp/env/bin/activate
$ (env) pip uninstall -y fabric
$ (env) pip install fabric
'libssh2.h' file not found
表示在安装ssh-python
之前,需要先安装相应的lib:
$ brew install libssh2
关于python - Pip 问题 - 由于 EnvironmentError 无法安装包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50639973/
每当我运行 pip 在 Ubuntu 16.04 中安装像 virtualenv 这样的 Flask 包时,我都会收到这个错误: pip install virtualenv 要求已经满足:./.lo
我正在尝试通过 pip 在我的 64 位 ARMV8 板上安装 imutils 和 dlib。pip3 install imutils抛出证书验证失败错误。我现在必须使用 pip3 install i
我正在尝试使用 this repositorie 在 CentOS7 机器上对我的 MQTT 网络进行负载测试在github上。我执行了以下命令来安装 python-mosquitto 依赖项。 #
我正在我工作的 amazon ec2 linux 服务器中输入以下内容。 (启用 ENV) pip install pillow 出现这个错误: Could not install packages
我想我在 Mac 上使用 Python 和/或 pip 时遇到了一些问题。我在全局范围内安装了 Python 2.7,然后我通常设置 virtualenvs 并安装 Python3.6.4,但在最后一
在我的 MacOS Mojave 终端中,我想用 pip 安装一个 python 包。最后说: You are using pip version 10.0.1, however version 18
python中通过pip安装库文件时出现“EnvironmentError: [WinError 5] 拒绝访问” 我遇到的问题:电脑上已经有了一个numpy==1.19.1,但是出于某种原因,我
当 os.environ 被赋予一个未设置的环境变量的名称时,它会抛出一个 KeyError: In [1]: my_value = os.environ['SOME_VALUE'] --------
我正在尝试使用 python 3.8 下载一些包,但每次我尝试安装像 sklearn 或 scipy 这样的包时,我得到这个错误: 由于环境错误无法安装包:[WinError 123] 文件名、目录名
我正在尝试安装 jupyterthemes 包并遇到此错误。 Collecting jupyterthemes Retrying (Retry(total=4, connect=None, rea
当我尝试 git push heroku master 时出现这个错误当我点击链接时,我收到这条消息“方法不允许”我该怎么做才能解决这个问题?错误从这一行开始 remote: Dow
我正在尝试关注 guide安装python模块但是我似乎没有安装虚拟环境或pip所以我试图让那些继续。 Python 2.7.5 安装在我的 cpanel 上,我想为我的脚本安装额外的模块。我下载:
我在Pycharm中安装ansible模块时,出现如下错误: ERROR: Could not install packages due to an EnvironmentError: [Errno
这是我得到的错误 (mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python Downloading/un
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 11 个月前关闭。 Improve
我试图安装 turicreate 使用 pip install -U turicreate 但得到了错误 Could not install packages due to an Environmen
在这里发布问答,因为目前还没有关于此类错误的帖子,网络搜索上的其他链接导致 Unresolved gihub 问题。这是我刚刚在我的虚拟 python 环境中更新一个包: (py36) $ pip i
我收到这个错误: Could not install packages due to an EnvironmentError: Could not find a suitable TLS CA cer
我正在尝试下载 kivy使用 pip 的模块. 当我运行 pip install command ,我收到一个错误:Could not install packages due to an Envir
我想在anaconda中安装三个包,但是我遇到了以下错误。 错误:由于 OSError 无法安装包:[Errno 2] 没有这样的文件或目录:'c:\\programdata\\anaconda3\\
我是一名优秀的程序员,十分优秀!