Python distribute (Setuptools) module.
Questions tagged [distribute]
228 questions
639
votes
5 answers
Differences between distribute, distutils, setuptools and distutils2?
The Situation
I’m trying to port an open-source library to Python 3. (SymPy, if anyone is wondering.)
So, I need to run 2to3 automatically when building for Python 3. To do that, I need to use distribute. Therefore, I need to port the current…

VPeric
- 7,391
- 6
- 21
- 17
250
votes
15 answers
What's the proper way to install pip, virtualenv, and distribute for Python?
Short Question
What is the proper way to install pip, virtualenv, and distribute?
Background
In my answer to SO question 4314376, I recommended using ez_setup so that you could then install pip and virtualenv as follows:
curl -O…

Matthew Rankin
- 457,139
- 39
- 126
- 163
122
votes
7 answers
What does "error: option --single-version-externally-managed not recognized" indicate?
I seem to have suddenly started to encounter the error error: option --single-version-externally-managed not recognized when using pip install with various packages (including PyObjC and astropy).
I've never seen this error before, but it's now also…

keflavich
- 18,278
- 20
- 86
- 118
111
votes
4 answers
When to use pip requirements file versus install_requires in setup.py?
I'm using pip with virtualenv to package and install some Python libraries.
I'd imagine what I'm doing is a pretty common scenario. I'm the maintainer on several libraries for which I can specify the dependencies explicitly. A few of my…

Joe Holloway
- 28,320
- 15
- 82
- 92
79
votes
3 answers
what is the best practice of distributing binaries from a github project?
what is the best practice of distributing binaries from a github project?
I can think of:
Create a bin folder in your project where you keep a copy of the binaries.
However, github is meant to store source code and not binaries Storing large and…

Jos de Jong
- 6,602
- 3
- 38
- 58
66
votes
5 answers
Why does "python setup.py sdist" create unwanted "PROJECT-egg.info" in project root directory?
When I run
python setup.py sdist
it creates an sdist in my ./dist directory. This includes a "PROJECT-egg.info" file in the zip inside my "dist" folder, which I don't use, but it doesn't hurt me, so I just ignore it.
My question is why does it…

Jonathan Hartley
- 15,462
- 9
- 79
- 80
60
votes
1 answer
How do setuptools, distribute, and pip relate to one another?
I've been teaching myself Python through the book "Learn Python The Hard Way" (2nd Edition). In exercise 46 it told me to read up on Pip, Distribute, and a few other packages.
The documentation for pip was clear enough. It allows me to…

Ben G
- 26,091
- 34
- 103
- 170
60
votes
2 answers
How to easily distribute Python software that has Python module dependencies? Frustrations in Python package installation on Unix
My goal is to distribute a Python package that has several other widely used Python packages as dependencies. My package depends on well written, Pypi-indexed packages like pandas, scipy and numpy, and specifies in the setup.py that certain…

yyk
- 681
- 1
- 5
- 8
59
votes
2 answers
install_requires based on python version
I have a module that works both on python 2 and python 3. In Python<3.2 I would like to install a specific package as a dependency. For Python>=3.2.
Something like:
install_requires=[
"threadpool >= 1.2.7 if python_version < 3.2.0",
],
How…

iTayb
- 12,373
- 24
- 81
- 135
50
votes
3 answers
Specify where to install 'tests_require' dependencies of a distribute/setuptools package
When I run python setup.py test the dependencies listed in tests_require in setup.py are downloaded to the current directory. When I run python setup.py install, the dependencies listed in requires are instead installed to site-packages.
How can I…

Danny Navarro
- 2,733
- 1
- 18
- 22
48
votes
3 answers
Does pip handle extras_requires from setuptools/distribute based sources?
I have package "A" with a setup.py and an extras_requires line like:
extras_require = {
'ssh': ['paramiko'],
},
And a package "B" that depends on util:
install_requires = ['A[ssh]']
If I run python setup.py install on package B, which uses…

dsully
- 483
- 1
- 5
- 6
46
votes
8 answers
Easy_install and pip broke: pkg_resources.DistributionNotFound: distribute==0.6.36
I was tried to upgrade pip with pip install --upgrade pip on OSX and pip and easy_install both dont work.
When running pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in
from pkg_resources import…

shshank
- 2,571
- 1
- 18
- 27
45
votes
5 answers
PIP: Installing only the dependencies
I have a script that creates a virtualenv, installs distribute and pip in it and then optionally clones a git repo.
Now I have the project I will be working on, installed. But its dependencies are not installed. How can I make pip install all the…

muhuk
- 15,777
- 9
- 59
- 98
39
votes
2 answers
Pip: Specifying minor version
In my requirements.txt file I want to specify that my app needs Django version 1.3.x. That is, either 1.3.0, or 1.3.1, or 1.3.2, etc. (When these come out.) But not 1.4, when it comes out.
What's the syntax for this?

Ram Rachum
- 84,019
- 84
- 236
- 374
39
votes
1 answer
How do I use data in package_data from source code?
In setup.py, I have specified package_data like this:
packages=['hermes'],
package_dir={'hermes': 'hermes'},
package_data={'hermes': ['templates/*.tpl']},
And my directory structure is roughly
hermes/
|
| docs/
| ...
| hermes/
|
|…

Scott
- 10,407
- 13
- 37
- 35