问题:
#python3 setup.py install
失败
环境:RHEL 8 UBI容器
我有一个看起来像这样的setup.py :(对此setup.py的任何指针或更新将不胜感激)
import setuptools
print('python/setup.py')
setuptools.setup(
name="process_data",
version="1.0",
description="desc",
author="FirstName LastName",
author_email="[email protected]",
url="https://some.com",
packages=setuptools.find_packages(),
)
我具有这样的目录结构(每个目录中都有<some>.py
,以及__init__.py
:]
python/
setup.py
<dir>/__init__.py
<dir>/__init__.py
<dir4>/__init__.py
<dir4>/<sub-dir1>/__init__.py
<dir4>/<sub-dir1>/<sub-dir>__init__.py
我希望每个目录中的代码都成为模块包的一部分,以便我可以导入,但嵌套得很深。
我正在这样做:
#cd python
#python3 setup.py install
我收到此错误:
python/setup.py
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:
/usr/local/lib/python3.6/site-packages/test-easy-install-1625.write-test
[Errno 2] No such file or directory: '/usr/local/lib/python3.6/site-packages/test-easy-install-1625.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python3.6/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).
问题:
这是哪里来的: test-easy-install-1625.write-test
? (对这是什么感到困惑)
在我的系统上,实际上这个目录不存在(为什么 python3 setup.py install在那儿看?什么叫它在那儿看?):/usr/local/lib/python3.6
我的setup.py
中没有任何东西可以指示要去那里寻找。
我四处张望,看起来我的/ site-packages /目录在这里(当我运行pip时,安装了其他模块)
`/usr/local/lib64/python3.6/site-packages/`
我该如何解决?
谢谢,我非常需要立即解决此问题。我一直在Windows上工作,>python setup.py install
只是在那里工作。
我应该设置任何环境变量吗?
我只是用dnf -y install python36
安装了python,就是这样。 (最新的版本可以在任何RHEL 8软件包存储库中进行安装)。
下面是我的安装命令和结果: