问题描述:

I have been trying to install pypol in cygwin. But when I do setup where I have to type python setup.py install then it displays an error as the following:

Traceback (most recent call last):

File "setup.py", line 1, in

from setuptools import find_packages, setup, Command

File "/cygdrive/c/pypol_-0.4/setuptools/init.py", line 2, in

from setuptools.extension import Extension, Library

File "/cygdrive/c/pypol_-0.4/setuptools/extension.py", line 2, in

from setuptools.dist import _get_unpatched

File "/cygdrive/c/pypol_-0.4/setuptools/dist.py", line 6, in

from setuptools.command.install import install

File "/cygdrive/c/pypol_-0.4/setuptools/command/init.py", line 8, in

from setuptools.command import install_scripts

File "/cygdrive/c/pypol_-0.4/setuptools/command/install_scripts.py", line 3, in

from pkg_resources import Distribution, PathMetadata, ensure_directory

ImportError: No module named pkg_resourceserror

Its clear that some of the modules are missing in my setuptools but I installed the setuptools again and they are still not there. How do I get out of this problem? Please help. Thank you.

网友答案:

What is causing ImportError: No module named pkg_resources after upgrade of Python on os X?

is informative. It suggests that you're invoking the wrong version of python. Do you already have python installed under Windows?

If you do have another version of Python (you can probably check under cygwin with which python) make sure that you're invoking the right one, which is most easily done by putting its binary path at the beginning of your PATH environmental variable in your ~/.bashrc or similar.

Then, re-install setuptools with the correct python, and everything should go smoothly.

Really, the linked answer tells you all you need to know, except it's talking about multiple versions on OSX rather than Windows.

I see that none of your previous questions have an accepted answer, please click the check mark next to the best answer to your question.

相关阅读:
Top