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
29
votes
1 answer

How can one fully replace distutils, which is deprecated in 3.10?

According to PEP 632, distutils will be formally marked as deprecated, and in Python 3.12, it will be removed. My product is soon going to support Python 3.10 and I don't want to put up with deprecation warnings, so I would like to remove references…
Alan
  • 1,889
  • 2
  • 18
  • 30
29
votes
5 answers

Force compiler when running python setup.py install

Is there a way to explicitly force the compiler for building Cython extensions when running python setup.py install? Where setup.py is of the form: import os.path import numpy as np from setuptools import setup, find_packages, Extension from…
rth
  • 10,680
  • 7
  • 53
  • 77
28
votes
4 answers

Python distutils error: "[directory]... doesn't exist or not a regular file"

Let's take the following project layout: $ ls -R . .: package setup.py ./package: __init__.py dir file.dat module.py ./package/dir: tool1.dat tool2.dat And the following content for setup.py: $ cat setup.py from distutils.core import…
Santa
  • 11,381
  • 8
  • 51
  • 64
28
votes
7 answers

How to access python package metadata from within the python console?

If I have built a python package employing distutils.core, e.g. via setup( ext_package="foo", author="me", version="1.0", description="foo package", packages=["foo",], ) where does all the metadata go (what is it intended for?)…
dastrobu
  • 1,600
  • 1
  • 18
  • 32
28
votes
4 answers

Custom distutils commands

I have a library called "example" that I'm installing into my global site-packages directory. However, I'd like to be able to install two versions, one for production and one for testing (I have a web application and other things that are versioned…
dave paola
  • 1,815
  • 3
  • 16
  • 27
27
votes
5 answers

Don't touch my shebang

One thing I hate about distutils (I guess he is the evil who does this) is that it changes the shebang line. In other words, the more rational and environment-vars decided scripture #!/usr/bin/env python gets magically converted into…
Stefano Borini
  • 138,652
  • 96
  • 297
  • 431
26
votes
4 answers

How do I write a setup.py for a twistd/twisted plugin that works with setuptools, distribute, etc?

The Twisted Plugin System is the preferred way to write extensible twisted applications. However, due to the way the plugin system is structured (plugins go into a twisted/plugins directory which should not be a Python package), writing a proper…
Sidnei
  • 531
  • 4
  • 8
26
votes
3 answers

Rename script file in distutils

I have a python script, myscript.py, which I wish to install using distutils: from distutils.core import setup setup(..., scripts=['myscript.py'], ...) I'd prefer if I could call the installed script using just myscript instead of typing…
pafcu
  • 7,808
  • 12
  • 42
  • 55
26
votes
2 answers

How can I make setuptools install a package from another source that's also available on pypi with the same version number?

It's a similar question to How can I make setuptools install a package that's not on PyPI? but not the same. As I would like to use the forked version of some package, setuptools ignore the dependency link (as it has the same version number). Is…
roberkules
  • 6,557
  • 2
  • 44
  • 52
25
votes
1 answer

why do I keep getting this message when installing saying EntryPoint must be in 'name=module:attrs [extras]

Hi I am on OSx Mavericks, using python 2.7 and pip version 6.0.8 and setuptools version 12.2. When I try to install my project I get warning messages but installs successfully $ python setup.py install --user if I use distutils I get below message…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
25
votes
5 answers

How to use Python distutils?

I wrote a quick program in python to add a gtk GUI to a cli program. I was wondering how I can create an installer using distutils. Since it's just a GUI frontend for a command line app it only works in *nix anyway so I'm not worried about it being…
Jiaaro
  • 74,485
  • 42
  • 169
  • 190
25
votes
1 answer

How to compile OpenGL with a python C++ extension using distutils on Mac OSX?

When I try it I get: ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/cscalelib.so, 2): Symbol not found: _glBindFramebufferEXT Referenced from:…
Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122
25
votes
3 answers

python setuptools install_requires is ignored when overriding cmdclass

I have a setup.py that looks like this: from setuptools import setup from subprocess import call from setuptools.command.install import install class MyInstall(install): def run(self): call(["pip install -r requirements.txt…
zseder
  • 1,099
  • 2
  • 12
  • 15
24
votes
4 answers

How to specify header files in setup.py script for Python extension module?

How do I specify the header files in a setup.py script for a Python extension module? Listing them with source files as follows does not work. But I can not figure out where else to list them. from distutils.core import setup, Extension from glob…
Johan Råde
  • 20,480
  • 21
  • 73
  • 110
24
votes
10 answers

Python Daemon Packaging Best Practices

I have a tool which I have written in python and generally should be run as a daemon. What are the best practices for packaging this tool for distribution, particularly how should settings files and the daemon executable/script be…
SeanOC
  • 1,331
  • 1
  • 8
  • 12