[英]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 --user
或pip install --user trains
給出
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
您有兩個選擇:
創建一個虛擬環境並在其中安裝您的軟件包(首選)
通過傳遞 --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.