Python 3可以';找不到setuptools模块-Ubuntu
我完成了Github回购协议,正在努力编译该项目。我正在使用Ubuntu,并试图使用setup.py文件进行安装,但我发现:Python 3可以';找不到setuptools模块-Ubuntu,python,bash,python-3.x,ubuntu,setuptools,Python,Bash,Python 3.x,Ubuntu,Setuptools,我完成了Github回购协议,正在努力编译该项目。我正在使用Ubuntu,并试图使用setup.py文件进行安装,但我发现: $sudo apt-get install python3-setuptools Reading package lists... Done Building dependency tree Reading state information... Done python3-setuptools is already the newest version
$sudo apt-get install python3-setuptools
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-setuptools is already the newest version (20.7.0-1)
0 upgraded, 0 newly installed, 0 to remove, and 100 not upgraded.
$python3 setup.py install
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup, find_packages
ModuleNotFoundError: No module named 'setuptools'
我在Ubuntu终端上运行这个。我想知道是否有人了解我的情况。谢谢 尝试直接从代码本身安装模块
try:
import setuptools
except:
import os
os.system("pip install setuptools")
del os
也许虚拟环境可以解决这个问题
sudo pip install virtualenv
virtualenv -p python3 myenv
source myenv/bin/activate
... do whatever you need to do.
我最终重新编译了我的Python3,它安装了最新版本的pip和setuptools,并且工作正常。问题解决了 看起来它仍然无法使用setuptools:它安装了setuptools,但却找不到setup()方法,我假设它在setuptools中`
sudo pip install virtualenv
virtualenv -p python3 myenv
source myenv/bin/activate
... do whatever you need to do.