Questions tagged [distutils]
Distutils is the standard packaging system for Python modules and applications.
1,124
questions
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:
(...
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 ...
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 ...
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?
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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', '...
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:
...
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",
...
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 ...
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 ...
-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 ...
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 ...
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 ...
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 ...
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
- - - ...
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:\...
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 ...
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 ...
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/...
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)
...
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 ...
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\...
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 ...
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 ...
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 ...
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....
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 ...
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\...
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 ...
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 ...
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 ...
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, ...
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 ...
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-...
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
...
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 ...
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/...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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....
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',
...