I don't understand why I keep getting ModuleNotFoundError

69 views Asked by At

I have this package, setuptools, installed on my local machine as you will in the command line code attached, but I don't understand why I keep getting the modulenotfound error.

PS C:\Users\MY PC\desktop\django-polls> easy_install --version
setuptools 41.2.0 from c:\users\my pc\appdata\local\programs\python\python38\lib\site-packages (Python 3.8)
PS C:\Users\MY PC\desktop\django-polls> python setup.py sdist
Traceback (most recent call last):
  File "setup.py", line 1, in <module>
    from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
PS C:\Users\MY PC\desktop\django-polls> pip install setuptools
Requirement already satisfied: setuptools in c:\users\my pc\anaconda3\lib\site-packages (52.0.0.post20210125)
PS C:\Users\MY PC\desktop\django-polls> python setup.py sdist
Traceback (most recent call last):
  File "setup.py", line 1, in <module>
    from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
PS C:\Users\MY PC\desktop\django-polls>
3

There are 3 answers

0
Shamim On

It looks you are not in virtual environment, please try to create new or use existing virtual environment and install all required package including django in it.

1
Nick Gomes On

This may not work but did you try to install it in the working directory I see you have it in the "my pc" directory

Try to install it in the working directory of "django-polls" and check whether it works or not.

Let me know if that does anything for you.

0
Blake McFarlane On

If you are using a virutal environment that may be the reason you are experiencing this. Try installing the package while the VE is active. However, I am learning Django myself but figured I would give it a shot. Good luck.