Questions tagged [distutils]

Distutils is the standard packaging system for Python modules and applications.

Distutils is the standard packaging system for Python modules and applications.

It has many high and low level features used to build, distribute and install Python projects. The official documentation page provides a good overview of its capabilities.

1123 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
282
votes
15 answers

Including non-Python files with setup.py

How do I make setup.py include a file that isn't part of the code? (Specifically, it's a license file, but it could be any other thing.) I want to be able to control the location of the file. In the original source folder, the file is in the root of…
Ram Rachum
  • 84,019
  • 84
  • 236
  • 374
201
votes
4 answers

setuptools vs. distutils: why is distutils still a thing?

Python has a confusing history of tools that can be used to package and describe projects: these include distutils in the Standard Library, distribute, distutils2, and setuptools (and maybe more). It appears that distribute and distutils2 were…
cel
  • 30,017
  • 18
  • 97
  • 117
191
votes
14 answers

How to include package data with setuptools/distutils?

When using setuptools, I can not get the installer to pull in any package_data files. Everything I've read says that the following is the correct way to do it. Can someone please advise? setup( name='myapp', packages=find_packages(), …
cmcginty
  • 113,384
  • 42
  • 163
  • 163
161
votes
4 answers

How can I make setuptools install a package that's not on PyPI?

I've just started working with setuptools and virtualenv. My package requires the latest python-gearman that is only available from GitHub. The python-gearman version that's on PyPI is an old one. The Github source is setuptools-compatible, i.e. has…
andrei
  • 2,053
  • 3
  • 17
  • 16
147
votes
8 answers

DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both

I've been usually installed python packages through pip. For Google App Engine, I need to install packages to another target directory. I've tried: pip install -I flask-restful --target ./lib but it fails with: must supply either home or…
Arthur Kim
  • 1,781
  • 2
  • 13
  • 13
133
votes
10 answers

pypi UserWarning: Unknown distribution option: 'install_requires'

Does anybody encounter this warning when executing python setup.py install of a PyPI package? install_requires defines what the package requires. A lot of PyPI packages have this option. How can it be an "unknown distribution option"?
Tyler Liu
  • 19,552
  • 11
  • 100
  • 84
123
votes
6 answers

pip cannot uninstall : "It is a distutils installed project"

I tried to install the Twilio module: sudo -H pip install twilio And I got this error: Installing collected packages: pyOpenSSL Found existing installation: pyOpenSSL 0.13.1 Cannot uninstall 'pyOpenSSL'. It is a distutils installed project and …
rachelvsamuel
  • 1,551
  • 2
  • 10
  • 21
121
votes
11 answers

how to install python distutils

I just got some space on a VPS server(running on ubuntu 8.04), and I'm trying to install django on it. The server has python 2.5 installed, but I guess its non standard installation. When I run install script for django, I…
Neo
  • 13,179
  • 18
  • 55
  • 80
117
votes
6 answers

Combine --user with --prefix error with setup.py install

I was trying to install Python packages a system I recently gained access to. I was trying to take advantage of Python's relatively new per user site-packages directory, and the new option --user. (The option is currently undocumented, however it…
gotgenes
  • 38,661
  • 28
  • 100
  • 128
115
votes
4 answers

Compiling with cython and mingw produces gcc: error: unrecognized command line option '-mno-cygwin'

I'm trying to compile a python extension with cython in win 7 64-bit using mingw (64-bit). I'm working with Python 2.6 (Active Python 2.6.6) and with the adequate distutils.cfg file (setting mingw as the compiler) When executing >…
joaquin
  • 82,968
  • 29
  • 138
  • 152
105
votes
6 answers

How to copy directory recursively in python and overwrite all?

I'm trying to copy /home/myUser/dir1/ and all its contents (and their contents, etc.) to /home/myuser/dir2/ in python. Furthermore, I want the copy to overwrite everything in dir2/. It looks like distutils.dir_util.copy_tree might be the right tool…
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
103
votes
6 answers

MANIFEST.in ignored on "python setup.py install" - no data files installed?

Here's my stripped-down setup.py script with non-code stuff removed: #!/usr/bin/env python from distutils.core import setup from whyteboard.misc import meta setup( name = 'Whyteboard', version = meta.version, packages =…
Steven Sproat
  • 4,398
  • 4
  • 27
  • 40
99
votes
5 answers

Is there a standard way to create Debian packages for distributing Python programs?

There is a ton of information on how to do this, but since "there is more than one way to skin a cat", and all the tutorials/manuals that cover a bit of the process seem to make certain assumptions which are different from other tutorials, I still…
mac
  • 42,153
  • 26
  • 121
  • 131
88
votes
8 answers

distutils: How to pass a user defined parameter to setup.py?

How can I pass a user-defined parameter both from the command line and setup.cfg configuration file to distutils' setup.py script? I want to write a setup.py script, which accepts my package specific parameters. For example: python setup.py install…
Mher
1
2 3
74 75