I'm having troubles with installing packages in Python 3.
I have always installed packages with setup.py install
command. But now when I try to install ansicolors package I get:
importerror "No Module named Setuptools"
I have no idea what to do because I haven't have Setuptools never and still I have installed many packages with setup.py install
command without setuptools and now I should get setuptools.
I can't even install setuptools because I have python 3.3 and setuptools doesn't support python 3.
Why my install command doesn't work anymore?
pip uninstall setuptools
and then:
pip install setuptools
This works for me and fix my issue.
EDIT: Official setuptools dox page:
Therefore the rest of this post is probably obsolete (e.g. some links don't work).
Distribute - is a setuptools fork which "offers Python 3 support". Installation instructions for distribute(setuptools) + pip:
Similar issue here.
UPDATE: Distribute seems to be obsolete, i.e. merged into Setuptools: Distribute is a deprecated fork of the Setuptools project. Since the Setuptools 0.7 release, Setuptools and Distribute have merged and Distribute is no longer being maintained. All ongoing effort should reference the Setuptools project and the Setuptools documentation.
You may try with instructions found on setuptools pypi page (I haven't tested this, sorry :( ):
Your
setup.py
file needssetuptools
. Many of the Python packages usedistutils
for the distribution, but some usesetuptools
, a more complete package. Here is a question about the differences between them.Regarding Python 3.3, you should installdistribute
instead. It is a more recent package that works in the same way assetuptools
(it's even calledsetuptools
internally).UPDATE (Oct 2014): Distribute has been merged with setuptools 0.7, so just get setuptools for both Python 2.7 and 3.x
To install this on Debian:
For Python 3.x
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):Download https://bootstrap.pypa.io/get-pip.py
I was doing this inside a virtualenv on Oracle Linux 6.4 using python-2.6 so the apt-based solutions weren't an option for me, nor were the python-2.7 ideas. My fix was to upgrade my version of setuptools that had been installed by virtualenv:
After that, I was able to install packages into the virtualenv. I know this question has already had an answer selected but I hope this answer will help others in my situation.
The
distribute
package provides a Python 3-compatible version ofsetuptools
: http://pypi.python.org/pypi/distributeAlso, use
pip
to install the modules. It automatically finds dependencies and installs them for you.It works just fine for me with your package: