115

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

No module named setuptools.

Could you please let me know what should I do?

I am using python 2.7

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 <module> from setuptools import setup, find_packages ImportError: No module named setuptools 
3
  • 1
    ...but the title can be easily googled... and my favourite answer is currently this one Commented Sep 7, 2014 at 21:07
  • 3
    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 Commented Mar 8, 2016 at 22:49
  • For anyone else that had same issue I had: I had this problem trying to run the setup.py script for the Azure walinuxagent. Commented Oct 17, 2018 at 18:47

7 Answers 7

120

Install setuptools and try again.

try command:

sudo apt-get install -y python-setuptools 
Sign up to request clarification or add additional context in comments.

3 Comments

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.
Debian/ubuntu: apt-get install -y python-setuptools
This issue came up when optimizing a docker build file with apt install --no-install-recommends ...
55

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 

For python3:

sudo apt-get install -y python3-setuptools 

After that, install your package again normally, using

sudo python setup.py install 

That's all.

2 Comments

For Python 3, use sudo apt-get install -y python3-setuptools.
I still get "ImportError: No module named setuptools". I also opened a new command shell.
18

For Python Run This Command

apt-get install -y python-setuptools 

For Python 3.

apt-get install -y python3-setuptools 

Comments

15

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):

Download https://bootstrap.pypa.io/get-pip.py

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

Sample usage:

>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 

Comments

2

For python3 is:

sudo apt-get install -y python3-setuptools 

Comments

0

The question mentions Windows, and the accepted answer also works for Ubuntu, but for those who found this question coming from a Redhat flavor of Linux, this did the trick:

sudo yum install -y python-setuptools 

Comments

0

Install Specific Version:

pip install python-setuptools 

Upgrade python-setuptools

sudo pip3 install --upgrade python-setuptools 

Getting Dependency Error in Window 10 Use code: easy_install instead of pip install

easy_install python-setuptools 

Upgrade using easy install

sudo easy_install --upgrade python-setuptools 

On OSX System to install Module: Use code: brew install instead of pip install

brew install python-setuptools 

Without Using Pip :

 sudo apt-get install -y python-setuptools 

On CentOS7 or Linux Fedora:

yum -y install python-setuptools 

Or on Fedora try

sudo dnf install python-setuptools 

Command if Homebrew screws up your path on macOS:

python -m pip install python-setuptools 

For Python3 MacOs Homebrew screws

python3 -m pip install python-setuptools 

Verify module from list MacOs

pip freeze | grep python-setuptools 

For Execute on Anaconda as your python package manager

 conda install -c anaconda python-setuptools 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.