gpt4 book ai didi

python - 在 Python 中通过源代码安装时出现错误 "can' t create or remove files in install directory”

转载 作者:行者123 更新时间:2023-12-04 14:45:17 26 4
gpt4 key购买 nike

我正在尝试在云 Linux 中设置我的 Python 环境。我复制了工作文件夹“Artem's_strategy”,其中包含源代码 setup.py ,从本地PC到云端Linux系统。尝试安装时 setup.py 我收到以下错误

[ec2-user@ip-xxx Artem's_strategy]$ python3 setup.py install
running install
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

[Errno 2] No such file or directory: '/usr/local/lib/python3.7/site-packages/test-easy-install-2160.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

/usr/local/lib/python3.7/site-packages/

This directory does not currently exist. Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).

在其他线程中,我以使用 --install-dir 的形式找到了解决方案,这会带来以下错误:
[ec2-user@ip-xxx~]$ /home/ec2-user/Artem\'s_strategy/setup.py --install-dir=/usr/local/lib/python3.7/site-packages
: No such file or directory

检查文件夹我们可以看到 setup.py 此文件夹中存在:
[ec2-user@ip-xxx Artem's_strategy]$ ls -la
total 1480
-rwxr-xr-x 1 ec2-user ec2-user 354 Mar 17 15:51 setup.py

所以你从源代码安装的帮助 setup.py 将不胜感激。

最佳答案

你应该试试这个:

python setup.py install --user || exit 1
来源: https://github.com/hughperkins/pytorch/issues/8

关于python - 在 Python 中通过源代码安装时出现错误 "can' t create or remove files in install directory”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60727752/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com