Modulenotfounderror no module named setuptools python

pip install error: ModuleNotFoundError No module named ‘setuptools’

PS C:\Windows\system32> pip install virtualenvwrapper-win Collecting virtualenvwrapper-win Using cached virtualenvwrapper-win-1.2.1.zip Complete output from command python setup.py egg_info: Traceback (most recent call last): File «», line 1, in ModuleNotFoundError: No module named ‘setuptools’ Command «python setup.py egg_info» failed with error code 1 in

I’ve tried doing pip install setuptools and also tried uninstalling and reinstalling and update but the error persists. pip and python executables have been added to environment variables.

2 Answers 2

virtualenvwrapper-win is only intended for the DOS cmd.exe. From the README:

These scripts should work on any version of Windows (Windows XP, Windows Vista, Windows 7/8/10).

However, they only work in the regular command prompt. They will not work in Powershell. There are other virtualenvwrapper projects out there for Powershell.

Try installing the virtualenvwrapper-win module manually by downloading the ZIP archive from here: https://pypi.python.org/pypi/virtualenvwrapper-win

  • In your PowerShell console, go to the directory the archive downloaded to (mine goes to C:\Users\user\Downloads\ ) and run this to extract the archive: Expand-Archive .\virtualenvwrapper-win-1.2.1.zip
  • Still in PowerShell and in the same directory as above, run: cd .\virtualenvwrapper-win-1.2.1\virtualenvwrapper-win-1.2.1\
  • Next, run: python setup.py install

If all went well, you should see something like this:

 PS C:\Users\user\Downloads\virtualenvwrapper-win-1.2.1\virtualenvwrapper-win-1.2.1> python .\setup.py install running install running bdist_egg running egg_info writing virtualenvwrapper_win.egg-info\PKG-INFO writing dependency_links to virtualenvwrapper_win.egg-info\dependency_links.txt writing requirements to virtualenvwrapper_win.egg-info\requires.txt writing top-level names to virtualenvwrapper_win.egg-info\top_level.txt reading manifest file 'virtualenvwrapper_win.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'virtualenvwrapper_win.egg-info\SOURCES.txt' installing library code to build\bdist.win-amd64\egg running install_lib warning: install_lib: 'build\lib' does not exist -- no Python modules to install creating build creating build\bdist.win-amd64 creating build\bdist.win-amd64\egg creating build\bdist.win-amd64\egg\EGG-INFO installing scripts to build\bdist.win-amd64\egg\EGG-INFO\scripts running install_scripts running build_scripts creating build\scripts-3.6 copying scripts\add2virtualenv.bat -> build\scripts-3.6 copying scripts\cd-.bat -> build\scripts-3.6 copying scripts\cdproject.bat -> build\scripts-3.6 copying scripts\cdsitepackages.bat -> build\scripts-3.6 copying scripts\cdvirtualenv.bat -> build\scripts-3.6 copying scripts\folder_delete.bat -> build\scripts-3.6 copying scripts\lssitepackages.bat -> build\scripts-3.6 copying scripts\lsvirtualenv.bat -> build\scripts-3.6 copying scripts\mkvirtualenv.bat -> build\scripts-3.6 copying scripts\rmvirtualenv.bat -> build\scripts-3.6 copying scripts\setprojectdir.bat -> build\scripts-3.6 copying scripts\toggleglobalsitepackages.bat -> build\scripts-3.6 copying scripts\whereis.bat -> build\scripts-3.6 copying scripts\workon.bat -> build\scripts-3.6 creating build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\add2virtualenv.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\cd-.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\cdproject.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\cdsitepackages.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\cdvirtualenv.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\folder_delete.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\lssitepackages.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\lsvirtualenv.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\mkvirtualenv.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\rmvirtualenv.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\setprojectdir.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\toggleglobalsitepackages.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\whereis.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying build\scripts-3.6\workon.bat -> build\bdist.win-amd64\egg\EGG-INFO\scripts copying virtualenvwrapper_win.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO copying virtualenvwrapper_win.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO copying virtualenvwrapper_win.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO copying virtualenvwrapper_win.egg-info\not-zip-safe -> build\bdist.win-amd64\egg\EGG-INFO copying virtualenvwrapper_win.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO copying virtualenvwrapper_win.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO creating dist creating 'dist\virtualenvwrapper_win-1.2.1-py3.6.egg' and adding 'build\bdist.win-amd64\egg' to it removing 'build\bdist.win-amd64\egg' (and everything under it) Processing virtualenvwrapper_win-1.2.1-py3.6.egg creating c:\users\user\appdata\local\programs\python\python36\lib\site-packages\virtualenvwrapper_win-1.2.1-py3.6.egg Extracting virtualenvwrapper_win-1.2.1-py3.6.egg to c:\users\user\appdata\local\programs\python\python36\lib\site-packages Adding virtualenvwrapper-win 1.2.1 to easy-install.pth file Installing add2virtualenv.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing cd-.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing cdproject.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing cdsitepackages.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing cdvirtualenv.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing folder_delete.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing lssitepackages.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing lsvirtualenv.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing mkvirtualenv.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing rmvirtualenv.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing setprojectdir.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing toggleglobalsitepackages.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing whereis.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing workon.bat script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installed c:\users\user\appdata\local\programs\python\python36\lib\site-packages\virtualenvwrapper_win-1.2.1-py3.6.egg Processing dependencies for virtualenvwrapper-win==1.2.1 Searching for virtualenv==15.1.0 Best match: virtualenv 15.1.0 Adding virtualenv 15.1.0 to easy-install.pth file Installing virtualenv-script.py script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Installing virtualenv.exe script to C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts Using c:\users\user\appdata\local\programs\python\python36\lib\site-packages Finished processing dependencies for virtualenvwrapper-win==1.2.1 

Источник

Читайте также:  Метод дифференциальной эволюции python

Ошибка «ModuleNotFoundError: No module named ‘setuptools’» (РЕШЕНО)

При установки пакетов Python с помощью pip или setup.py может возникнуть ошибка «No module named ‘setuptools’».

Эта ошибка появляется при использовании команды:

sudo pip3 install -r requirements.txt
Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'setuptools'

Файл setup.py и pip нуждаются в setuptools. Некоторые пакеты Python используют для развёртывания distutils, но в настоящее время большинство использует setuptools.

Setuptools — это расширение для python-distutils для больших и сложных развёртываний.

То есть указанная ошибка возникает из-за отсутствия пакета setuptools. Его можно установить несколькими способами.

Если у вас Ubuntu, Linux Mint, Debian или производный от них дистрибутив, то вы можете установить этот пакет из стандартных репозиториев:

sudo apt install python3-setuptools

Если вы уже установили PIP (а именно пакет python3-pip), то вместо указанной выше команды, можно выполнить такую:

sudo pip3 install --upgrade setuptools

Выберите первую или вторую, не нужно выполнять их обе.

Если у вас Windows, то установка делается так:

python -m pip install -U pip setuptools

Как переустановить setuptools

Если у вас уже есть setuptools, но его версия слишком старая и возникают проблемы при обновлении, то переустановите его следующим образом (должен быть установлен пакет python3-pip, это делается командой sudo apt install python3-pip):

sudo pip3 uninstall setuptools
sudo pip3 install setuptools

Источник

No module named setuptools

I want to install setup file of twilio. When I install it through given command it is given me an error:

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Python27>python D:\test\twilio-twilio-python-26f6707\setup.py install Traceback (most recent call last): File "D:\test\twilio-twilio-python-26f6707\setup.py", line 2, in from setuptools import setup, find_packages ImportError: No module named setuptools 

I’m voting for reopen since I have this problem on Ubuntu 14.04 and it is not due to a x86 / x64 conflict of the installer. In short I simply needed to install pip — sudo apt-get install python-pip

Читайте также:  Java load properties resources

For anyone else that had same issue I had: I had this problem trying to run the setup.py script for the Azure walinuxagent.

7 Answers 7

sudo apt-get install -y python-setuptools 

I was going to vote you down for not providing the command to install setuptools but you really do need to go to that URL to see how to install it on your specific system.

For ubuntu users, this error may arise because setuptool is not installed system-wide. Simply install setuptool using the command:

sudo apt-get install -y python-setuptools 
sudo apt-get install -y python3-setuptools 

After that, install your package again normally, using

sudo python setup.py install 

For Python Run This Command

apt-get install -y python-setuptools 
apt-get install -y python3-setuptools 

The PyPA recommended tool for installing and managing Python packages is pip . pip is included with Python 3.4 (PEP 453), but for older versions here’s how to install it (on Windows, using Python 3.3):

>c:\Python33\python.exe get-pip.py Downloading/unpacking pip Downloading/unpacking setuptools Installing collected packages: pip, setuptools Successfully installed pip setuptools Cleaning up. 
>c:\Python33\Scripts\pip.exe install pymysql Downloading/unpacking pymysql Installing collected packages: pymysql Successfully installed pymysql Cleaning up. 

In your case it would be this (it appears that pip caches independent of Python version):

C:\Python27>python.exe \code\Python\get-pip.py Requirement already up-to-date: pip in c:\python27\lib\site-packages Collecting wheel Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB) 100% |################################| 69kB 255kB/s Installing collected packages: wheel Successfully installed wheel-0.29.0 C:\Python27>cd Scripts C:\Python27\Scripts>pip install twilio Collecting twilio Using cached twilio-5.3.0.tar.gz Collecting httplib2>=0.7 (from twilio) Using cached httplib2-0.9.2.tar.gz Collecting six (from twilio) Using cached six-1.10.0-py2.py3-none-any.whl Collecting pytz (from twilio) Using cached pytz-2015.7-py2.py3-none-any.whl Building wheels for collected packages: twilio, httplib2 Running setup.py bdist_wheel for twilio . done Stored in directory: C:\Users\Cees.Timmerman\AppData\Local\pip\Cache\wheels\e0\f2\a7\c57f6d153c440b93bd24c1243123f276dcacbf43cc43b7f906 Running setup.py bdist_wheel for httplib2 . done Stored in directory: C:\Users\Cees.Timmerman\AppData\Local\pip\Cache\wheels\e1\a3\05\e66aad1380335ee0a823c8f1b9006efa577236a24b3cb1eade Successfully built twilio httplib2 Installing collected packages: httplib2, six, pytz, twilio Successfully installed httplib2-0.9.2 pytz-2015.7 six-1.10.0 twilio-5.3.0 

Источник

Оцените статью