当我尝试setup.py安装一个软件包时,我得到了以下ImportError:
Traceback (most recent call last):
File "setup.py", line 4, in <module>
from setuptools import setup, Extension
ImportError: No module named setuptools尽管已经安装了setuptools,但仍会发生这种情况:
amir@amir-debian:~$ sudo apt-get install python-setuptools
[sudo] password for amir:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-setuptools is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.为什么python找不到setuptools模块?
发布于 2016-10-08 06:55:03
您的系统上可能安装了多个python版本。例如,如果您从源代码安装python,然后使用apt-get再次安装。Apt-get将安装到默认的python版本。确保你是始终如一的。
潜在地使用pip install setuptools可以解决您的问题。
尝试以下命令:
$which python
/usr/bin/python
$python --version
Python 2.7.12确保输出符合您的期望。
删除以前的安装并重新开始可能是值得的,正如下面的答案所示:
https://stackoverflow.com/questions/39926760
复制相似问题