簡體   English   中英

pip install planemo 失敗並出現錯誤:“錯誤:由於 OSError 無法安裝軟件包:[Errno 13] 權限被拒絕:'/usr/local/locale'”

[英]pip install planemo fails with error: "ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/locale'"

我正在嘗試像這樣安裝planemo

/usr/local/bin/pip3 install virtualenv
virtualenv .venv
. .venv/bin/activate
/usr/local/bin/pip3 install planemo

最后一個命令失敗並顯示以下錯誤消息:

ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/locale'
Consider using the `--user` option or check the permissions.

WARNING: You are using pip version 21.0.1; however, version 22.2 is available.
You should consider upgrading via the '/usr/local/opt/python@3.9/bin/python3.9 -m pip install --upgrade pip' command.

如何解決這個問題?

. .venv/bin/activate

此行將激活您的虛擬環境。 在這種情況下,“激活”意味着設置一堆環境變量,包括PATH

/usr/local/bin/pip3 install planemo

然后通過使用絕對路徑調用 pip3 來完全忽略PATH 做那個

pip install planemo

它應該可以工作。

該錯誤是由過時的pip版本引起的。 請注意,錯誤消息后面有一些提示,其中之一可以解決問題。 只需升級pip

/usr/local/opt/python@3.9/bin/python3.9 -m pip install --upgrade pip

現在這有效:

/usr/local/bin/pip3 install planemo

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM