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
18
votes
3 answers

Changing console_script entry point interpreter for packaging

I'm packaging some python packages using a well known third party packaging system, and I'm encountering an issue with the way entry points are created. When I install an entry point on my machine, the entry point will contain a shebang pointed at…
gepoch
  • 711
  • 6
  • 17
18
votes
1 answer

Using CMake with setup.py

For a project I build a C library and implict Python bindings (via GObject introspection) with CMake. I also want to distribute some Python helper modules using distutils. I am able to build and install the module with this…
matthias
  • 2,161
  • 15
  • 22
17
votes
6 answers

python setup.py sdist error: Operation not permitted

I'm trying to create a python source package, but it fails when creating hard links for files. $ python setup.py sdist running sdist running check reading manifest template 'MANIFEST.in' writing manifest file 'MANIFEST' making hard links in…
rlayte
  • 538
  • 4
  • 12
17
votes
6 answers

no module named distutils....but distutils installed?

I was wanting to upgrade my python version (to 3.10 in this case) so after installing python3.10 I proceeded to try adding some modules I use e.g. opencv , which ran into: jeremy@jeremy-Blade:~$ python3.10 -m pip install opencv-python Traceback…
jeremy_rutman
  • 3,552
  • 4
  • 28
  • 47
17
votes
2 answers

How to install a dependency from a submodule in Python?

I have a Python project with the following structure (irrelevant source files omitted for simplicity): myproject/ mysubmodule/ setup.py setup.py The file myproject/setup.py uses distutils.core.setup to install the module myproject…
jotrocken
  • 2,263
  • 3
  • 27
  • 38
17
votes
1 answer

Is it possible to wrap a function from a shared library using F2PY?

I'm developing a package that requires Python bindings for the dgtsv subroutine from the LAPACK Fortran library. At the moment, I'm distributing the Fortran source file, dgtsv.f, alongside my Python code, and using numpy.distutils to automatically…
ali_m
  • 71,714
  • 23
  • 223
  • 298
17
votes
1 answer

A simple Hello World setuptools package and installing it with pip

I'm having trouble figuring out how to install my package using setuptools, and I've tried reading the documentation on it and SO posts, but I can't get it to work properly. I'm trying to get a simple helloworld application to work. This is how far…
antimatter
  • 3,240
  • 2
  • 23
  • 34
17
votes
3 answers

Passing the library path as a command line argument to setup.py

modules = [Extension("MyLibrary", src, language = "c++", extra_compile_args=["-fopenmp", "-std=c++11", "-DNOLOG4CXX"], # log4cxx is not currently used …
Alexey
  • 379
  • 1
  • 3
  • 10
17
votes
2 answers

How to perform custom build steps in setup.py?

The distutils module allows to include and install resource files together with Python modules. How to properly include them if resource files should be generated during a building process? For example, the project is a web application which…
eigenein
  • 2,083
  • 3
  • 25
  • 43
16
votes
3 answers

python setup.py develop to override installed version

I have a package I am developing. This package is already installed as an egg file parked in the site-packages directory, egg path added to easy-install.pth. I now realized I have a bug in the package, so I invoked python setup.py develop to hook…
Stefano Borini
  • 138,652
  • 96
  • 297
  • 431
16
votes
2 answers

pip download without executing setup.py

How to download a distribution, possibly sdist, without potentially executing a setup.py file (that may contain malicious code)? I don't want to recursively get the dependencies, only download one file for the specified distribution. Attempt that…
wim
  • 338,267
  • 99
  • 616
  • 750
16
votes
4 answers

Is it possible to require PyQt from setuptools setup.py?

I'm building a small app that uses PyQt and tought it'd be nice to declare that dependency in setup.py. However, according to this blog (first hit on google for pyqt setuptools) says it can't be done, and the last paragraph here doens't try to do…
Macke
  • 24,812
  • 7
  • 82
  • 118
16
votes
1 answer

How do I package for distribution a python module that uses a shared library?

I'm writing some bindings for a C library and am not sure how to configure all this for distribution so it is possible to pip install my package. Let's say I have the following files: library.c library.h wrapper.py In order for my wrapper library…
coleifer
  • 24,887
  • 6
  • 60
  • 75
16
votes
8 answers

PyCrypto install error on Windows

I am trying to install PyCrypto 2.6 Library on my computer. But I keep getting the following error D:\Software\Python\package\pycrypto-2.6>python setup.py build running build running build_py running build_ext warning: GMP or MPIR library not found;…
Khurram Majeed
  • 2,291
  • 8
  • 37
  • 59
16
votes
2 answers

Hook to add commands to distutils build?

I've added a custom distutils command to a setup.py script: from distutils.command.build_py import build_py cmdclass = {} cmdclass['build_qt'] = BuildQt cmdclass['build_py'] = build_py setup(..., cmdclass=cmdclass, ...) Is there a way to make it…
astrofrog
  • 32,883
  • 32
  • 90
  • 131