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
20
votes
6 answers

ValueError: Unknown MS Compiler version 1900

I am trying to run some code with Python 3.5 on Windows 10 with the use of cygwin (mingw). To be precise I am using the PyDSTool module, where I call the dopri integrator. The problem is, I am having trouble with distutils not recognizing Microsoft…
blaz
  • 4,108
  • 7
  • 29
  • 54
19
votes
2 answers

Shared library dependencies with distutils

I'm a newbie to distutils and I have a problem that really has me stuck. I am compiling a package that requires an extension, so I make the extension thus: a_module = Extension( "amodule", ["initmodule.cpp"], …
Mike Vella
  • 10,187
  • 14
  • 59
  • 86
19
votes
3 answers

Best practices for Python deployment -- multiple versions, standard install locations, packaging tools etc

Many posts on different aspects of this question but I haven't seen a post that brings it all together. First a subjective statement: it seems like the simplicity we experience when working with the Python language is shot to pieces when we move…
Chris Johnson
  • 20,650
  • 6
  • 81
  • 80
19
votes
5 answers

How to install python-distutils for old python versions

I am running Ubuntu 20.04 with python 3.6, 3.7, and 3.8 installed. I am trying to install some packages using pip on 3.6 and 3.7 versions using 'python3.7 -m pip install package' but, I am getting this error: ModuleNotFoundError: No module named…
newbie
  • 443
  • 1
  • 4
  • 14
19
votes
1 answer

What does `python setup.py check` actually do?

What exactly does python setup.py check actually do?
Dave
  • 7,555
  • 8
  • 46
  • 88
19
votes
2 answers

python distutils does not include data_files

I am new to distutils.. I am trying to include few data files along with the package.. here is my code.. from distutils.core import setup setup(name='Scrapper', version='1.0', description='Scrapper', packages=['app', 'db',…
StackUnderflow
  • 24,080
  • 14
  • 54
  • 77
19
votes
5 answers

Distribute pre-compiled python extension module with distutils

Quick one today: I'm learning the in's and out's of Pythons distutils library, and I would like to include a python extension module (.pyd) with my package. I know of course that the recommended way is to have distutils compile the extension at the…
Toji
  • 33,927
  • 22
  • 105
  • 115
19
votes
7 answers

Sort Versions in Python

I'm trying to get it so that 1.7.0 comes after 1.7.0.rc0 but before 1.8.0, as it should if you were sorting versions. I thought the whole point of LooseVersion was that it handled the sorting and comparison of this kind of thing correctly. >>> from…
Tyler Brock
  • 29,626
  • 15
  • 79
  • 79
18
votes
2 answers

How do I create Python eggs from distutils source packages?

I vaguely remember some sort of setuptools wrapper that would generate .egg files from distutils source. Can someone jog my memory?
Ben
  • 2,422
  • 2
  • 16
  • 23
18
votes
2 answers

Cross Compiling Python Extensions

I have a problem with cross-compiling netifaces extension under Buildroot Linux distro for ARM (Python 2.7.2). According to this blog http://whatschrisdoing.com/blog/2009/10/16/cross-compiling-python-extensions/ I've defined CC, LDSHARE etc.…
yegorich
  • 4,653
  • 3
  • 31
  • 37
18
votes
3 answers

"error: Unable to find vcvarsall.bat" when compiling Cython code

As suggested here, I have succesfully installed Microsoft Visual C++ Compiler for Python 2.7 to compile some Cython code, but: from distutils.core import setup from Cython.Build import cythonize setup(ext_modules = cythonize("module1.pyx")) still…
Basj
  • 41,386
  • 99
  • 383
  • 673
18
votes
2 answers

Python: Installing man pages in distutils based project

I have a Python project which is basically a set of command line scripts and a helper package. As these scripts have a number of command line options I decided to create a manual page for each script and used ronn (http://rtomayko.github.com/ronn/)…
18
votes
1 answer

Referring to existing distutils options inside setup.cfg and setup.py

I am using Python 2.7 with Distutils to distribute and install my self-created package. My setup.cfg looks like this: [install] prefix=/usr/local/MODULENAME record=installation.txt I have two questions: Is it possible to refer to variables set…
Naturjoghurt
  • 541
  • 6
  • 21
18
votes
3 answers

How to tell which specific compiler will be invoked for a Python C extension: GCC or Clang?

I have a Python C++ extension that requires the following compilation flags when compiled using Clang on OS X: CPPFLAGS='-std=c++11 -stdlib=libc++ -mmacosx-version-min=10.8' LDFLAGS='-lc++' Detecting OS X in my setup.py is easy enough. I can do…
syllogism_
  • 4,127
  • 29
  • 22
18
votes
3 answers

Best way to package a Python library that includes a C shared library?

I have written a library whose main functionality is implemented in C (speed is critical), with a thin Python layer around it to deal with the ctypes nastiness. I'm coming to package it and I'm wondering how I might best go about this. The code it…
obeattie
  • 3,264
  • 2
  • 31
  • 36