How to Get Setuptools and Easy_Install?

I downloaded the ez_setup code from here: and ran it, but i don't think setuptools was properly installed. When i try to open an egg using easy_install i am getting a NameError. Any thoughts?

Here is the specific error:

Traceback (most recent call last):
  File "C:...setup.py", line 223, in <module>
    easy_install eggsetup.py
NameError: name 'easy_install' is not defined
3

9 Answers

For linux versions(ubuntu/linux mint), you can always type this in the command prompt:

sudo apt-get install python-setuptools

This will automatically install easy_install.

2

For python3 on Ubuntu

 sudo apt-get install python3-setuptools

please try to install the dependencie with pip, run this command:

sudo pip install -U setuptools
1
apt-get install python-setuptools python-pip

or

apt-get install python3-setuptools python3-pip

you'd also want to install the python packages...

Give this link a try -->

I'm assuming you're on Windows (could be wrong) but if you click the green Downloads button, it should take you to a table where you can choose to download a .exe version of setuptools appropriate for your version of Python. All that eggsetup stuff should be taken care of in the executable file.

Let me know if you need more help.

2

2021 update:

  • easy_install no longer exists, it was replaced by pip install.

  • setuptools is built-in with Python 3. It's the package to read package files (wheels) and do things under the hood.

  • pip is built-in with Python 3.

  • venv is built-in with Python 3.

Some operating systems (Debian) like to split packages into smaller independent packages, you may have to sudo apt-get install python3 python3-pip python3-venv to get all the executables. Nonetheless, the tools are usually available even if the command isn't exposed, try calling python3 -m pip install ....

On Ubuntu until python-distribute is something newer than 0.7 I'd recommend:

$ wget  -O - | sudo python

See

2

For Amazon Linux AMI

yum install -y python-setuptools 

If you are installing from distro packages, then this probably doesn't apply to your scenario...

recompile python

I have multiple versions of Python built from source installed, and I found I didn't have setuptools for version 3.5. It seems like I was missing the zlib libraries when I compiled 3.5, which subsequently made the setuptools install fail quietly (to me at least). Recompiling with the zlib libs installed fixed this for me.

install from GitHub

If you are for some reason missing setuptools and have Python compiled with all the necessary libs, you should be able to install it from the GitHub repo like this:

git clone 
cd ./setuptools
python3.5 bootstrap.py
sudo python3.5 setup.py install
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest