繁体   English   中英

pip install tr​​ains 失败

[英]pip install trains fails

在我的虚拟环境中运行pip install trains

我正进入(状态

    ERROR: Command errored out with exit status 1:
     command: /home/epdadmin/noam/code/venv_linux/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"'; __file__='"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lxz5t8pu/install-record.txt --single-version-externally-managed --compile --install-headers /home/epdadmin/noam/code/venv_linux/include/site/python3.8/retrying
         cwd: /tmp/pip-install-owzh8lnl/retrying/
    Complete output (10 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib
    copying retrying.py -> build/lib
    running install_lib
    copying build/lib/retrying.py -> /home/epdadmin/noam/code/venv_linux/lib/python3.8/site-packages
    byte-compiling /home/epdadmin/noam/code/venv_linux/lib/python3.8/site-packages/retrying.py to retrying.cpython-38.pyc
    error: [Errno 13] Permission denied: '/home/epdadmin/noam/code/venv_linux/lib/python3.8/site-packages/__pycache__/retrying.cpython-38.pyc.139678407381360'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/epdadmin/noam/code/venv_linux/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"'; __file__='"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lxz5t8pu/install-record.txt --single-version-externally-managed --compile --install-headers /home/epdadmin/noam/code/venv_linux/include/site/python3.8/retrying Check the logs for full command output.

我知道在使用 venv 时我不应该在 sudo 下运行,所以我真的不明白这个问题

运行例如pip install pandas确实有效。

蟒蛇 3.8

如何安装火车?


编辑:

运行pip install trains --userpip install --user trains给出

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

您有两个选择:

  1. 创建一个虚拟环境并在其中安装您的软件包(首选)

  2. 通过传递 --user 标志将您的软件包安装在您的用户主目录中

    pip install --user

问题是 venv 的权限问题。 另一个问题是火车需要一些在 Python3.8 上还没有带轮子的包,所以我不得不将 Python 降级到 3.7

该 venv 是使用 Pycharm 创建的,出于某种原因,它是以低权限创建的。

可能有一种方法可以提升其权限,但我只是删除了它并使用命令行创建了另一个

python -m virtualenv --python=/usr/bin/python3.7 venv

现在pip install trains工作了。

很烦人。

我在 Ubuntu 18 中安装 matplotlib 时遇到了同样的错误。

运行这些行对我有用:

sudo apt-get install python3-dev
apt-get install build-essential

如在安装脚本中发现的退出错误:命令 'x86_64-linux-gnu-gcc' failed with exit status 1

暂无
暂无

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

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