Questions tagged [distutils]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

build_ext runs twice when doing "pip install -e"

I am compiling OpenAI Triton from source. When running "pip install -e python" in the root dir, which uses this setup.py https://github.com/openai/triton/blob/main/python/setup.py, I see: (...
Andrei Gheorghe's user avatar
0 votes
1 answer
34 views

How can I create a single Python package from a Cython files (.pyx) that includes multiple .pyx files using build package

I'm trying to build a python package of a collection of Cython functions under one package name, using include statement in Cython, following the idea of this. Here's the file organization (root ...
ysroh260's user avatar
1 vote
0 answers
25 views

Is there an easy way to build a PyPi package that uses deprecated Numpy API in C?

I'm trying to build K-Means 2, and have been trying to run the below setup.py file using python setup.py install, pip install kmc2, and pip install . from the source package. I have Numpy version 1.2X ...
nini2352's user avatar
0 votes
1 answer
30 views

How can I rename my project on PyPI to fix its capitalization?

My PyPI project has an error in its name. Concretely, it has the wrong capitalization. So, e.g., instead of project I used the name Project. How can I change the name on PyPI to fix this mistake?
vauhochzett's user avatar
  • 2,837
0 votes
1 answer
26 views

Python setup.py: import packages from subdirectories not specifying top level directory

I am trying to write setup.py such that I will be able to import submodules from package_3 directly, without specifying top level (from package_3 import submodule_1), not as from package_3.package_3 ...
aaxx's user avatar
  • 55
0 votes
0 answers
66 views

"ImportError: cannot import name 'DistutilsOptionError' from 'distutils.core'" while attempting to install software from Github?

I am trying to install a software called OpenNFT from Github using pip onto a laptop running Windows 11, but am running into an error involving the setup.py script that I can't seem to resolve. I ...
tiaroun's user avatar
0 votes
0 answers
73 views

Extension Build Failing: "DLL load failed while importing (custom module): The specified module could not be found" For C++ Python Extension Module

I've been stuck at this problem for a while now. I'm currently creating an extension module for Python called simulations. This extension is written in C++. For this extension, I needed to use the gsl ...
Tomatotum's user avatar
  • 111
0 votes
0 answers
54 views

Fail to install batman package (package for modeling a light curve of exoplanet)

I tried to install the package using this command on anaconda prompt pip install batman-package As the tutorial on this website https://github.com/lkreidberg/batman/issues/26 said, but it didn't work....
Geron Naren's user avatar
0 votes
0 answers
87 views

cannot import python package from dist-packages

On Ubuntu, with multiple python installation and python 3.11 not the default one. When I try to install keyring on python3.11 /usr/bin/python3.11 -m pip install keyring I get Defaulting to user ...
Eliseo Di Folco's user avatar
0 votes
0 answers
81 views

EXE created with PyInstaller: "Cannot copy tree 'Y': not a directory"

I converted a file, main.py, into main.exe, using PyInstaller. main.py doesn't throw any error, but main.exe does. The script didn't execute fully, so I used a try-catch and got this: Cannot copy ...
The Amateur Coder's user avatar
0 votes
0 answers
39 views

Flask Apache Ubuntu pipenv install AttributeError: module 'distutils' has no attribute 'util'

When I try to execute the 'pipenv install' command, I get the error: Backtrace (last call last): File "/usr/bin/pipenv", line 11, in load_entry_point('pipenv==11.9.0', 'console_scripts', '...
Zhsv's user avatar
  • 1
0 votes
0 answers
148 views

virtualenv without distutils

I'm copying a virtual environment created with virtualenv venv in a ubuntu wsl to another distro. After activating the venv in the new system, the command pip3 --version returns the following error: ...
andre.hre's user avatar
0 votes
0 answers
58 views

Is there a way to pre-define the python egg name programmatically?

from setuptools import setup, Extension kwargs = {"name": "foo", "author": "", "version": "1.0", ...
ealeon's user avatar
  • 12.1k
0 votes
1 answer
315 views

ModuleNotFoundError: No module named 'distutils.util' for python 3.9 as it is already installed for 3.8.10?

I am attempting to install the package pyminizip, but i get the error stating distutils.util module is missing and when attempting the fixes I found online when updating distutils it simply states I ...
Teun's user avatar
  • 11
0 votes
0 answers
69 views

Virtualenv: distutils.util not found but is installed

I'm sorry to make another thread on a question that seems to have been asked many times but I've read many and still can't figure out how to resolve it. I'm using virtualenv 20.15.0+ds to make a venv ...
M4rc0txt's user avatar
-1 votes
2 answers
1k views

distutils deprecation warning on ubuntu 22.04

I am deploying openstack using devstack but while deploying I encountered the following error: Error on exit /opt/stack/devstack/tools/worlddump.py:22: DeprecationWarning: The distutils package is ...
Claude Mutela's user avatar
0 votes
0 answers
24 views

Execute a Python script post install using setuptools [duplicate]

This is exactly the same as this question. The accepted (and only) answer uses distutils which is deprecated. Simply replacing from distutils.core import setup with from setuptools import setup and ...
Gulzar's user avatar
  • 23.7k
1 vote
0 answers
79 views

setuptools build multiple extensions

I have a c++ project I have successfully swigged for python and PyPI. My issue is when building multiple extensions with setuptools, the generated binaries from swig are not stored in the respective ...
aaries's user avatar
  • 113
2 votes
0 answers
58 views

How can a pre-built Python-installation be modified to work in another directory?

For a project shipping with a pre-built customized Python distribution I need to be able to compile packages from source using pip (within the installed environment). This is what the file system ...
frans's user avatar
  • 8,938
1 vote
0 answers
56 views

Python pip install altered data files

I have a python package that contains some data in a subdirectory of the package in numpys npz format. So the directory looks like - setup.py - Main Package - - Data Directory - - - file1.npz - - - ...
shanedrum's user avatar
  • 129
0 votes
0 answers
93 views

error processing line 1 of c in vscode terminal

**i'm trying to install django but this error keeps repeating ** Error processing line 1 of c:\python34\lib\site-packages\distutils-precedence.pth: Traceback (most recent call last): File "c:\...
rana omer's user avatar
0 votes
0 answers
74 views

Building pip package for multiple platforms

I have a project written in C++ with a binding for Python created with Swig. The use of the Python binding depends off of a shared library. Using distutils I have successfully created a pip package ...
aaries's user avatar
  • 113
0 votes
0 answers
536 views

Pycharm: ModuleNotFoundError: No module named 'distutils.cmd'

I'm trying to use opencv module with python. I have Python3.10. I installed the module and with the use of Python interpreter in the command line, writing "import cv2" it works fine. Now, I ...
marco94's user avatar
  • 167
1 vote
1 answer
1k views

UserWarning: Setuptools is replacing distutils. at building Hue : sudo make apps ,it fails with :

add the development packages, build and get the development server running: "PYTHON_VER is python3.7." "Python 3 module install via pip" "SYS_PYTHON is /root/.pyenv/shims/...
wachoo's user avatar
  • 11
0 votes
1 answer
113 views

Distutils build include C++ library with setup

I'm trying to link glfw to my C++ python extension but I can't do it without cmake. Here is how I did it in cmake: cmake_minimum_required(VERSION 3.0) project(Test) add_subdirectory(lib/glfw) ...
Turgut's user avatar
  • 649
0 votes
0 answers
29 views

Using C++ libraries while extending python with C++

I made a program in C++ and I would like to make a python module out of it. So far I have created an example project to test what I have learned so far. I've managed to make a hello world module in ...
Turgut's user avatar
  • 649
2 votes
1 answer
3k views

No module named 'distutils.command.bdist_msi'

In Pycharm (Windows 11) I set up a basic project consisting of one line: import pycurl The environment is Virtualenv, the base intepreter path is C:\Users\strat\AppData\Local\Programs\Python311\...
Life after Guest's user avatar
0 votes
0 answers
105 views

Compile full package with nested modules using numba Ahead-of-Time Compilation

I split up my numerical code into multiple modules, which all are part of a package. I would like to completely pre-compile the full package. The documentation just gives information on [how to ...
Philipp Stephan's user avatar
0 votes
0 answers
15 views

pass only: and skip: to f2py distutils

I am trying to pass only: and skip: options to f2py distutils Extension. How can(?) this be done? I tried to add to sources or to f2py_options, or just provide the name of the function(s) I want to ...
user3622450's user avatar
0 votes
0 answers
78 views

Error while installation pycuda ModuleNotFound: No module named 'distutils.command.sdist'

I'm trying to install pycuda with pip install pycuda in virtual environment. I installed python3.10-distutils, but the error remains. My system Ubuntu22.04, python3.10. I also have tried manual ...
Konstantin Konov's user avatar
0 votes
1 answer
411 views

Can't install <package_name>.tar.gz: ModuleNotFoundError: No module named '_version'

I have a problem to install packages like configobj or version with pip. So commands like pip install configobj lead to following outputs: Collecting configobj>=5.0.5 Using cached configobj-5.0.6....
Schuryk's user avatar
3 votes
1 answer
113 views

How to provide C++ version when extending python

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 ...
DiKetarogg's user avatar
7 votes
1 answer
3k views

Error processing line 1 of distutils-precedence.pth (no module named '_distutils_hack')

I'm on Windows 10 and working in a git-bash terminal with anaconda environment. When I open a new terminal, I'm immediately presented with: Error processing line 1 of C:\Users\e360769\AppData\Local\...
kevkev9957's user avatar
0 votes
1 answer
255 views

PyYAML failure to install with PyAutoLens on Ubuntu

I am trying to install PyAutoLens on my Ubuntu 20.04-running laptop using pip/pip3. It all seems to go well then I get the following and all dependencies seem to be satisfied until: Installing ...
PeterDz's user avatar
  • 93
0 votes
0 answers
79 views

Files specified in MANIFEST.in ignored when creating a python package

Maybe I'm already too tired (it's already late) but I'm not able to find out why files specified in MANIFEST.in are being ignored, even though include_package_data = True is set. Here's my training ...
brillenheini's user avatar
0 votes
1 answer
52 views

Custom module installed but can import by name

I have a project which I'm trying package with conda, install, and run. I cannot import the module by name, although installed. I can however import the module main.py and execute it's function ...
Liam Pieri's user avatar
0 votes
1 answer
224 views

Use distutils setuptools for compile and link

I want to compile and link some cython (and cython_freeze) generated c files into an executable (on Windows and Linux) I can do this by setting up (a machine specifc) environment (eg what C compiler, ...
Ruediger Jungbeck's user avatar
0 votes
0 answers
15 views

The package version does not appear to be updating when importing locally with pipenv, even when in editable (developer) mode

I have written a small python package on my machine and made it importable with distutils. My setup.py has version='0.0.3'. In a separate folder, I have a Pipenv environment and I install the package ...
Robino's user avatar
  • 4,571
1 vote
0 answers
318 views

Can't use pip-review to update packages and keep getting : ModuleNotFoundError: No module named 'distutils.command.bdist_msi'

I'm currently trying to use a convenient way to update my packages in my venv. I'm using for a while pip-review whith no problems. Currently using conda and Python 3.9.7 Now i'm using the classic pip-...
LSeu's user avatar
  • 630
0 votes
1 answer
307 views

Cython embed on Windows

I have read How to enable `--embed` with cythonize? and Cython --embed flag in setup.py but this method does not work on Windows. Let's say we have: # app.py print("hello") # build.py ...
Basj's user avatar
  • 41.7k
3 votes
1 answer
13k views

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

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 ...
bigbigpark's user avatar
1 vote
0 answers
212 views

How to fix the distutils.errors.LinkError when configuring PyStan on Windows

I am configuring PyStan on Windows and getting an error in the execution of the pystan.StanModel step. Configure exactly according to the official documentation: https://pystan2.readthedocs.io/en/...
kongzue's user avatar
  • 11
0 votes
0 answers
412 views

Setuptools: Creating custom command to install selected package dynamically

I have following package tree , I want to install the particular package from src and base (always install with selected package from src). I am trying to create custom command so that using pip I can ...
Piyush S. Wanare's user avatar
3 votes
1 answer
5k views

Python 3.10 deprecation warning for distutils

DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.dir_util import copy_tree Is ...
Chris P's user avatar
  • 2,061
1 vote
0 answers
217 views

Programmatically obtain Python install paths in prefix, without distutils

As distutils is being removed from Python in the > 3.10 versions, and setuptools will not be added to the stdlib, I want to replace an existing setup.py recipe for building/installing a C++ library ...
andybuckley's user avatar
  • 1,114
0 votes
0 answers
682 views

Include files in sdist but not wheel

I have a Python C extension that contains header files in the include folder. I am currently trying to build wheels and a source distribution. Because wheels are pre-compiled, they don't need to ...
GreyHope's user avatar
  • 102
1 vote
0 answers
118 views

Building f2py module with numpy.distutils

To build a project managed with poetry I need to build an f2py extension first. I am trying to achieve it with a separate build.py file inspired by this answer. For now my setup.py is: # In case of ...
Vadym Bidula's user avatar
0 votes
0 answers
2k views

Distutils was imported before Setuptool error

After upgrading pip on python3.5 I am getting the message File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 57 sys.stderr.write(f"ERROR: {exc}") I ...
Shantanu 's user avatar
5 votes
1 answer
1k views

What is the replacement for distutils.util.get_platform()?

Apparently, Python 3.10 / 3.12 is going to deprecate / remove distutils. Unfortunately, I have not been able to find a replacement for the one and only function I am using from it; distutils.util....
Matthew's user avatar
  • 2,603
0 votes
0 answers
84 views

Unable to import package installed in develop mode

Directory structure: root/ -> setup.py -> src/ -> -> package1/ -> -> -> __init__.py Content of setup.py from setuptools import setup setup( name='ptest', version='1.0', ...
mr_beginner's user avatar

1
2 3 4 5
23