【发布时间】:2020-06-28 20:25:43
【问题描述】:
我正在尝试在云 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?
-
Python 版本 3.7.6
-
试试我的答案,可能只是不同目录的情况。