Questions tagged [setuptools]
setuptools is a set of enhancements to Python's distutils which simplify building, distribution and installation of Python packages.
3,038
questions
1
vote
0
answers
20
views
Importing other files when using python setuptools entry_points - no module named
I am not familiar with setuptools so I hope this is a simple mistake (but couldn't find anything related).
I have this in my setup.py
entry_points={
'console_scripts':[
'filea=autostart....
1
vote
1
answer
20
views
setuptools not properly excluding tests
My package structure is
package
|-setup.py
|-package
| |-__init__.py
| |-source.py
|-test
|-__init__.py
|-test_source.py
I've got the line packages=find_packages(...
0
votes
0
answers
49
views
Warning: `importlib-metadata` version is incompatible with `setuptools`
I imported pandas library on jupyter notebook
After that a warning appears like importlib-metadata version is incompatible with setuptools.
And suggest for This problem is likely to be solved by ...
0
votes
0
answers
22
views
Use setuptools find_packages to exclude everything except package
I want to build a package using setup tools. To import package I am using find_packages from setuptools. I have lots of directory and I want to include only few of them. How can I achieve exclude ...
0
votes
0
answers
33
views
az cli version 2.37.0 error "ModuleNotFoundError: No module named 'setuptools._distutils' " caused by oci cli version 3.10.2 - fix, not question
This afternoon I installed the latest version of Azure's az cli after having just installed an upgrade to oci cli (oracle cloud infrastructure).
The issue is that oci cli installed setuptools to ~./...
0
votes
0
answers
40
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 ...
1
vote
1
answer
50
views
Setuptools package discovery
I have below package tree for my project
└── src
| ├── mypkg1
| │ ├── module1.py
| │ ├── module2.py
| │ └── __init__.py
| | |-- setup.py
| | |__ requirements.py
| └── ...
0
votes
1
answer
55
views
How to specify a different non-pypi package index url to setuptools.setup?
I'm trying to specify a package dependency not in pypi [but in jfrog/Artifactory] to setuptoools.setup()
Things I've tried:
Using the dependency_links argument to setuptools.setup() like so:
...
0
votes
0
answers
14
views
PIP - select setup on the basis of --install_package variable
I am trying to install particular package on the basis of name I will mention in --install_package variable.
setup.py
setup(
(name='package1', install_requires=['p1','p2']),
(name='package2', ...
0
votes
0
answers
24
views
Best practice for packaging Python bindings with fallback implementation (PEP 518)
Let's consider the following example.
There's a static C++ library libFoo, distributed as a CMake sub-project.
Now, there's a Python implementation of Foo, called pyFoo, which should provide Python ...
0
votes
1
answer
44
views
Proper imports in an installable python project
I'm trying to clean a python project on pypi to make it installable. It has the following structure (very simplified)
project_x/
project_x/
pack_a/
__init__.py
mod_a1.py
mod_a2....
0
votes
1
answer
36
views
why doesn't include resource files as expected? [duplicate]
from setuptools import setup, find_packages
LONGDOC = """
To be completed
"""
PACKAGES = find_packages()
def setup_package():
setup(name='wbn',
version='...
0
votes
2
answers
33
views
How to simply call a PYD from a wheel installed package?
I'm building a pyd file via pybind11. There's no python-only code in the project (not even in the final wheel). I'm packing this prebuilt pyd into a wheel package. It's all working well so far, but I'...
-1
votes
0
answers
20
views
build python package that internally runs makefile
Hi I'm trying to make a Python package that consists in a wrapper for a quite old C code (that only compiles with gcc). I managed to adapt a bit the code to make a shared library that could be called ...
0
votes
0
answers
24
views
Where does setup.py install console scripts to?
When I set up my package using setup.py to have a console script entry point, pip install -e . creates a cli exe in the C:\Users\...\anaconda3\envs\envname\Scripts\foo.exe.
However on a separate ...
0
votes
2
answers
158
views
'pip install regressors' - error is : " python setup.py egg_info did not run successfully. "
I can't install the regressors package with pip install regressors command in Windows 11.
The returned error is:
python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [32 lines ...
1
vote
1
answer
27
views
ModuleNotFoundError when using setup.py install version of package, but not locally-
Problem
python setup.py install installs a package I'm developing all fine, but when I try importing the package I get a "ModuleNotFoundError" saying that a local package could not be found....
0
votes
0
answers
28
views
Extending Python with C but got distutils error
I was trying to extend python With C
here is the C code:
#include <C:/Users/sanad/AppData/Local/Programs/Python/Python310/include/Python.h>
int Cadd_int(int a, int b){
return a + b;
}
...
0
votes
1
answer
35
views
Python setuptools - no module named after pip install
I want to create python CLI using click project and I have problems with packaging it. I created my script in mycli.py file like this
import click
from module1 import Service1
@click.group()
def ...
0
votes
1
answer
30
views
Python3: setup.py does not install package or subpackages
I would like help regarding setuptools and imports. I have been unable to run pip install . and have package importable by any arbitrary python script like this
import package
Here is an example file ...
0
votes
0
answers
29
views
Best approach to distribute a python package on a local segregated network
Dear community members,
I would like to have your opinions about my situation. I wrote some python modules to simplify the daily routine at work. I'm the only 'developer' and the user community is a ...
0
votes
0
answers
180
views
How do I fix setuptools not available in build environment when trying to install libraries in python?
I'm trying to install a requirements.txt file in Docker, and I make it about 30 packages in when I get this error when trying to install importlib:
Can not execute setup.py since setuptools is not ...
0
votes
0
answers
20
views
Package shown as github link in pip freeze not packagename==1.0.0
I have setup a project as per this solution:
Sibling package imports and installed as an 'editable' package by navigating to the root folder and running pip install -e .
This installs successfully but ...
0
votes
2
answers
42
views
Flutter Emulator issues
Screen of death; my version
I have 4 problems with this screen
1.) I have absolutely downloaded all the requirements
2.) my phone is on developer mode and connected to my laptop but isn't being read
3....
-1
votes
0
answers
43
views
How can I create my setup.py with non-python files and no-python files folders?
I want to make a setup.py for my project.
My project looks like this:
project
code
dependencies
translations
code1.py
code2.py
code3.py
img.png
README.md
README_ZH-CN.md
setup.py
I ...
0
votes
0
answers
27
views
Can't sdist a module with setuptools when setup.cfg is write-protected
I'm packaging with a small module named my_module; the build is described by a setup.cfg / setup.py pair. Those files are read-only (as they are monitored by a version controler that mark all files as ...
1
vote
1
answer
98
views
pip show not showing requirements
When I run the pip show command on my package Classeviva.py I get the following.
D:\Python\Python\Classeviva>pip show classeviva.py
Name: Classeviva.py
Version: 0.1.1.post1
Summary: Classeviva ...
4
votes
1
answer
71
views
setuptools pyproject.toml equivalent to `python setup.py clean --all`
I'm migrating from setup.py to pyproject.toml. The commands to install my package appear to be the same, but I can't find what the pyproject.toml command for cleaning up build artifacts is. What is ...
1
vote
0
answers
28
views
python setup.py looking in the wrong directory for dependencies
I'm using py2app and running my setup.py file in a local directory, which also reads a requirements.txt file for the install_required param. However, when running;
python3 setup.py py2app -A
I get ...
0
votes
1
answer
17
views
Exclude tests files from setuptools find packages
I'm trying to build a lib without the test files, as described here https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html. In the pyproject.toml, I got:
[tool.setuptools.packages.find]
...
0
votes
0
answers
50
views
constraints for indirect dependency in setup.py?
How do I specify version constraints of indirect dependencies in setup.py?
Assumptions
My python package p depends on package x
x depends on package y but my package p does not directly depend on y.
...
0
votes
1
answer
32
views
ModuleNotFoundError when trying to run executable created with setuptools
This is my project structure
/Users/tom/PycharmProjects/foo
├── __init__.py
├── foo
│ ├── __init__.py
│ ├── app.py
│ └── run.py
└── setup.py
app.py:
def hello_world():
print("Hello ...
-1
votes
1
answer
76
views
Can't install local python package
After few system upgrades I am no more able to install my Python 3 package. This is the output:
pab@pab:~/Mopiqtt-1.0.0 $ sudo pip3 install .
Looking in indexes: https://pypi.org/simple, https://...
1
vote
1
answer
30
views
How to package multiple single modules as sub-package with python setuptools
My Directory structure looks like follows.
pkg-folder
├── LICENSE
├── pkg-name
│ ├── __init__.py
│ ├── module1
│ │ ├── module1.py
│ │ ├── __init__.py
│ │ └── resourceFile.json
│ └── ...
1
vote
2
answers
80
views
How to define "python_requires" in pyproject.toml using setuptools?
Setuptools allows you to specify the minimum python version as such:
from setuptools import setup
[...]
setup(name="my_package_name",
python_requires='>3.5.2',
[...]
...
2
votes
0
answers
102
views
Can't install psycopg2 - Can not execute `setup.py`
I am trying to run the below command on Linux
pip3.9 install psycopg2
but it does not work as I get the following error message:
Collecting psycopg2
Using cached psycopg2-2.9.3.tar.gz (380 kB)
...
2
votes
1
answer
203
views
How to interpret the "Package would be ignored" warning generated by setuptools?
I work on several python packages that contain data within them. I add them via the MANIFEST.in file, passing include_package_data=True to setup. For example:
# MANIFEST.in
graft mypackage/plugins
...
1
vote
2
answers
95
views
Set `__version__` of module from a file when configuring setuptools using `setup.cfg` without `setup.py`
I’m following PyPA’s current guidance to use only setup.cfg without setup.py for configuring metadata when building a package for distribution. (“Static metadata (setup.cfg) should be preferred. ...
1
vote
0
answers
24
views
Python venv shim shebang absolute path not working
EDIT:
This appears to be a shebang character limit issue. The workaround appears to be to create a wrapper script. If anyone has a better solution I'm all ears!
I'm building a CLI tool, i'm using ...
0
votes
0
answers
14
views
How to make setuptools include a package from higher up in my source tree?
I am trying to use setuptools with the sdist command to create a .tar.gz file of my code so that I can deploy it as a Vertex AI Custom Training Job.
My code is organized like this:
root
job1
...
0
votes
1
answer
16
views
Python package organization/setup to shorten import
so I'm preparing a Python package which is completely new for me. The structure is as follow:
package_name/
├── package_name/
├── datasets/
├── __init__.py
└── functions.py
├── tests/
├── ...
0
votes
0
answers
15
views
How can I write a setup.py that ensures a non-code (data) file is at the same relative path from my script as in my repository?
When I'm developing a project, and a script script.py needs access to some data file data.txt, I will usually write something like this:
path = Path(__file__).parent.parent / "resources" / &...
0
votes
0
answers
24
views
Setuptools does not install dependencies when packaging [toml project]
Guys, I'm trying to package my python project, but when I run the python3 -m build command in the terminal, the build run properly, but the dependencies are not being installed
I have the .toml file ...
0
votes
0
answers
58
views
pip3 install reads from setup.cfg
I am on Ubuntu 21.10 and created a small python package which also consists of a setup.py and setup.cfg file. In my setup.cfg there are these lines:
[install]
install_scripts = /etc/icinga2/scripts
...
0
votes
0
answers
17
views
Can I define a dependency for the `setup.py` script itself?
I have a project that depends on the YouTokenToMe package. The setup.py of YouTokenToMe uses Cython.Build.cythonize() to generate the ext_modules.
This means that pip install in a new environment (...
0
votes
0
answers
42
views
Cython & tox - ModuleNotFoundError on 3.9, but not 3.8
I'm converting some of my scripts in my package to cython to try and speed up execution time, and I'm having some trouble getting it to work with tox.
The tests are passing on 3.8, but on 3.9 I get ...
1
vote
0
answers
30
views
Importing Setuptools tools error (ModuleNotFoundError: No module named 'setuptools') Python
I get an error when I try to import setuptools, I have python version Python 3.9.12 and I have the following packages and versions below. I am on a windows 10 system. Anyone know how to fix this?
...
2
votes
1
answer
36
views
Cannot import a setup.py module while inside a venv
I'm trying to test a package that I hope to eventually register on PyPI. Unfortunately, I can't seem to install it correctly on my own machine, or at least, I cannot use the module via import. I keep ...
0
votes
1
answer
38
views
Edit location of compiled files with setuptools
I am using setuptools to compile a pyx file using Cython using the following code in my setup.py
from Cython.Distutils import build_ext
extensions=[Extension("filtering.filter", "...
0
votes
0
answers
124
views
Git versioning with setuptools in pyproject.toml
I'm trying to build a few packages with an automatic versioning set by setuptools-git-versioning. Unfortunately, even following the documentation and the very few resources online, I can manage to ...