distutils

How to provide C++ version when extending python

How to provide C++ version when extending python Question: I want to make c++ code callable from python. https://docs.python.org/3/extending/ explains how to do this, but does not mention how to specify c++ version. By default distutils calls g++ with a bunch of arguments, however does not provide the version argument. Example of setup.py: from distutils.core …

Total answers: 1

How to fix 'UserWarning: Distutils was imported before Setuptools'?

How to fix 'UserWarning: Distutils was imported before Setuptools'? Question: When I cloned some packages including python tools, an error occured: Errors << unique_id:cmake /home/scpark/cps_ws/logs/unique_id/build.cmake.001.log CMake Warning (dev) at CMakeLists.txt:2 (project): Policy CMP0048 is not set: project() command manages VERSION variables. Run "cmake –help-policy CMP0048" for policy details. Use the cmake_policy command to set the …

Total answers: 2

AssertionError inside of ensure_local_distutils when building a PyInstaller exe using setuptools/distutils

AssertionError inside of ensure_local_distutils when building a PyInstaller exe using setuptools/distutils Question: I am trying to convert some Python code into an .exe with PyInstaller. My code uses distutils, which has already caused me some head scratching in the past as it seems to duplicate setuptools functionality, and interacts with it strangely. It e.g. requires …

Total answers: 2

How to ensure the MSVC++ Redistributable is available on user's system?

How to ensure the MSVC++ Redistributable is available on user's system? Question: I wrote a Python library in C++14. Since users often do not have a C++ compiler installed, I create wheels for Linux, Windows and macOS and upload those to PyPI. While this works fine for Linux and macOS, on Windows it is required …

Total answers: 1

What's the recommended way of renaming a project in pypi?

What's the recommended way of renaming a project in pypi? Question: I want people that know of the old name to be directed to the new name. For the pypi website, it’s easy to upload a package with a README linking to the new package. I’m not sure what’s the best way to handle people …

Total answers: 2

What keyword arguments does setuptools.setup() accept?

What keyword arguments does setuptools.setup() accept? Question: What is the full list of keyword arguments that the setuptools.setup() function accepts? (Please include a description of what each argument means, if possible.) I have looked all over the web and I can’t believe this isn’t documented. I found these documents: https://docs.python.org/3.7/distutils/setupscript.html#additional-meta-data https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords But even when I …

Total answers: 1

Make distutils place compiled extensions in the right folder

Make distutils place compiled extensions in the right folder Question: I wrote a Python C extension that I’m building with distutils. This is setup.py: from distutils.core import setup, Extension utilsmodule = Extension(‘utils’, sources = [‘utilsmodule.c’]) setup (name = ‘myPackage’, version = ‘1.0’, description = ‘My package’, ext_modules = [utilsmodule]) When I run python setup.y build, …

Total answers: 3

pip cannot uninstall <package>: "It is a distutils installed project"

pip cannot uninstall <package>: "It is a distutils installed project" Question: 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 thus we cannot accurately determine which files belong …

Total answers: 6

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

"error: Unable to find vcvarsall.bat" when compiling Cython code Question: 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 produces: error: Unable to find vcvarsall.bat How to compile Cython code with Python …

Total answers: 3

pip 10 and apt: how to avoid "Cannot uninstall X" errors for distutils packages

pip 10 and apt: how to avoid "Cannot uninstall X" errors for distutils packages Question: I am dealing with a legacy Dockerfile. Here is a very simplified version of what I am dealing with: FROM ubuntu:14.04 RUN apt-get -y update && apt-get -y install python-pip python-numpy # …and many other packages RUN pip install -U …

Total answers: 4