Importerror: No Module Named Setuptools

Importerror: No Module Named Setuptools Average ratng: 9,5/10 7590 reviews
  • ImportError: No module named setuptools No module named MySq No module named yum No module named mime.text No module named rpm No module named seri no module named mss No module named ssl No module named djan no module named win3 ImportError.
  • 运行命令:python get-pip.py 当你执行其他第三方工具安装时,遇到提示: ImportError: No module named 'setuptools'.
  1. Importerror No Module Named Sysconfig
  2. Importerror No Module Named Setuptools_ext

$ python2.7 overlappingreads.py Traceback (most recent call last): File 'overlappingreads.py', line 4, in module import pysam ImportError: No module named pysam Can someone help?also, belo is portion of my script if that helps.

Users are getting 'ImportError: No module named setuptools' when using pip to upgrade a package since distribute-0.7.3 was released.

Pycharm no module named setuptools

e.g. when running a command like this: pip install --upgrade pyramid

Solution

To prevent the problem in new environments (that aren't broken yet),

Importerror: No Module Named Setuptools
  1. First run pip install -U setuptools,
  2. Then run the command to upgrade your package (e.g. pip install --upgrade pyramid)

To fix the problem once it's occurred, you'll need to manually install the new setuptools, then rerun the upgrade that failed.

  1. Download ez_setup.py (https://bitbucket.org/pypa/setuptools/downloads/ez_setup.py)
  2. Run python ez_setup.py
  3. Then rerun your upgrade (e.g. pip install --upgrade pyramid)

Also note that pip-1.4 (unreleased) has fixes to prevent this

Cause

Importerror No Module Named Sysconfig

distribute-0.7.3 is just an empty wrapper that only serves to require the new setuptools (setuptools>=0.7) so that it will be installed. (if you don't know yet, the 'new setuptools' is a merge of distribute and setuptools back into one project)

distribute-0.7.3 does it's job well, when the upgrade is done in isolation. E.g. if you're currently on distribute-0.6.X, then running pip install -U setuptools works fine to upgrade you to setuptools>=0.7.

The problem occurs when:

Importerror: No Module Named Setuptools
  1. you are currently using an older distribute (i.e. 0.6.X)
  2. and you try to use pip to upgrade a package that depends on setuptools or distribute.

As part of the upgrade process, pip builds an install list that ends up including distribute-0.7.3 and setuptools>=0.7 , but they can end up being separated by other dependencies in the list, so what can happen is this:

  1. pip uninstalls the existing distribute
  2. pip installs distribute-0.7.3 (which has no importable setuptools, that pip needs internally to function)
  3. pip moves onto install another dependency (before setuptools>=0.7) and is unable to proceed without the setuptools package

Note that pip-1.4 (unreleased) has fixes to prevent this. distribute-0.7.3 (or setuptools>=0.7) by themselves cannot prevent this kind of problem.

Posted by2 years ago
Archived

Importerror No Module Named Setuptools_ext

Hi guys. I am trying to install Kivy on my laptop. I have installed the dependencies outlined [here] (https://kivy.org/docs/installation/installation-windows.html) but when I run python -m pip install kivy I get the error from the title. I tried rerunning the dependency installation commands with setuptools in to ensure they were installed and it said it was already installed. When I installed Python I made sure to add it to my path also. I'm not sure what's the issue here. Any suggestions?

11 comments