Questions tagged [setup.py]
setup.py is a Python script required by libraries packaged and distributed with Distutils.
1,742
questions
0
votes
0
answers
13
views
custom Python package seemingly installs but ModuleNotFound on import
I am trying to turn my python code into a package.
I have the following structure
package_name
src/
__init__.py
module/
__init__.py
code.py
module2/...
0
votes
0
answers
20
views
Error during package installation from testpypi [duplicate]
I wrote a library package and uploaded it to pypi.On trying to install it using the pip command, I am getting an error.
The setup.py file has install_requires with the below:
install_requires=['...
0
votes
0
answers
40
views
Python module setup.py dependency updates by Renovate combined with GitLab Package Registry
We have Python modules, which were referencing other Python modules from an internal GitLab Package Registry. The setup.py looks like the following:
import setuptools
setuptools.setup(
name="...
0
votes
0
answers
22
views
Import Error while making a package using setup.py
I am trying to build a python package which has a setup.py file , I created an entry point but I run through it then it gives import error otherwise if run normally in vs code it does not gives import ...
0
votes
0
answers
29
views
Python wheel file with private artifactory
I am preparing a wheel file where it should use private artifactory instead of pypi.
My folder structure
project
.config
pip
pip.conf
src
__init__.py
setup.py
requirements....
0
votes
1
answer
62
views
Unable to install CuPy 12.2.0 on Google Colab
I want to use CuPy 12.2.0 on Colab, but the default CuPy version installed on Colab is 11.0.0.
I tried several ways to install version 12.2.0, all of which failed.
When I tried to install cupy with ...
0
votes
0
answers
25
views
Building wheel with setup.py and skbuild in linux fails due to permission (Works in Windows)
I'm trying to build a wheel for my package in Linux and get an permission error at a late stage in the build process. This is the error message I get in Linux:
...
...
copying _skbuild/linux-x86_64-3....
1
vote
1
answer
54
views
What's the difference between 'pip3 install -e .' and 'python3 setup.py develop'
When installing a Python package locally in editable mode, both 'pip3 install -e .', and 'python3 setup.py develop', will both install the package locally in editable mode. I know that 'pip3 install -...
0
votes
0
answers
8
views
Is it possible to build pytorch to dlopen from a separate libtorch installation?
I'd like to reuse my Linux libtorch installation in Pytorch as well. The benefits would be:
reducing unpacked Python package size by ~600MB of shared objects
certainty that I'm using the same backend ...
0
votes
0
answers
20
views
Setup.py not working and seems to install github path rather than library name
I'm working in a folder corresponding to my github repo myapp and attempting to make this an installable library. I have followed the instructions both here: https://medium.com/analytics-vidhya/how-to-...
0
votes
0
answers
24
views
Additional imports in setup.py
My project
myproject/
setup.py
myproject/
__init__.py
helper_cy.pyx
main.py
won't install using pip when the setup.py additionally imports cythonize from Cython.Build.
#setup....
0
votes
0
answers
38
views
Building a Wheel File with extra_requires using Tox
I have a Python multi-module project with a setup.py file that defines extra dependencies using extra_requires. I want to use Tox to build a wheel file that includes these extra dependencies. However, ...
0
votes
0
answers
31
views
Add django package dependency to project setting installed app
I write django package name example and it has dependency to other package like rest-frame work. I want
to my dependencies be added to installed app of project that using this app, text,I have seen ...
0
votes
0
answers
45
views
Python wheel package paths
I'm developing a package called my_package with python wheel. An index.html file gets created during the build, but I have troubles retrieving it.
This is my package structure:
.
├── my_package
│ ├──...
0
votes
1
answer
177
views
How to build a python package with setup.py?
I'm trying to build package so that i can install it simply with pip3 command. It is an open-source project. Can someone please suggest me how to make it work.
This is content of my setup.py
from ...
0
votes
1
answer
249
views
Get python-dotenv "OSError: Starting path not found" in a python package install using `setup.py install`
Problem description
When working with environment vars, a .env file is used for development via python-dotenv. When the app is distributed (and so installed using setuptools), the env vars are ...
1
vote
0
answers
168
views
How to install a library wheel during package installation (via pyproject.toml or setyp.py)?
I have a package build into a .whl that needs some libraries to be installed prior to the package installation.
Their presence are checked within the pyproject.toml and its dependencies section:
...
0
votes
0
answers
135
views
Python setup.py with src directory
I have a simple project folder which looks like this:
.
├── setup.py
├── src
├── __init__.py
└── pricing_functions.py
and I want to make it an installable package.
What I want is to have the ...
1
vote
1
answer
65
views
Change pip build directory from read-only file system
I have a repo on a read-only file system (I cannot get write access), so I can't make changes to it at all. But I want to run pip install . and install any needed files to my home location ~. Here is ...
0
votes
0
answers
30
views
Python Package does not have package_data
I am new to python and trying to package my python code using below command.
python setup.py sdist bdist_wheel
Problem: The utilites directory is not part of the package. I am not able to import from ...
0
votes
0
answers
175
views
how to have a monorepo with many sub-packages in python?
I have the following setup:
monorepo/
|_ sub_pkg1/
|_ sub_pkg1/
|_ __init__.py
|_ func.py # where there's a class A
|_ setup.py # sub_pkg1's setup
|_ sub_pkg2/
|_ sub_pkg2/
|_ ...
0
votes
0
answers
50
views
Can't override option version in setup.py despite pyproject.toml
What I am trying to achieve is to create a GitHub workflow that releases my Python library to PyPI when someone pushed on one of the tags (i.e., 1.0.0, 1.1.0) and set it to be the version of the ...
0
votes
0
answers
22
views
gitlab published package import error: from python_proj_lib import app ModuleNotFoundError: No module named 'python_proj_lib'
I have a project set up with the below structure:
python-proj-lib
├── python_proj_lib
│ ├── __init__.py
│ ├── constants.py
│ ├── data_types.py
│ ├── app.py
├── README.md
├── ...
0
votes
0
answers
71
views
py2app add multiple libraries to setup.py
I used tkinter, pytube and os libraries in my project. I found a setup.py example but I don't how to add my libraries to setup file. Can anybody help me? This is the example file:
from setuptools ...
0
votes
0
answers
33
views
In setup.py , how to install dependencies in python lib directory while installing the package itself in a different local directory?
I created a Pypi package and uploaded it.
pyaml is a dependency needed by this package so I added the following lines in setup.py
install_requires=[
"PyYAML >= 6.0",
],
now i ...
0
votes
1
answer
120
views
Problem creating app with py2app: misssing rubicon
I'm trying to create an app from my python script on mac. Every time I've tried to create it by running $ python setup.py py2app in terminal I get an error " ImportError: No module named 'rubicon'...
0
votes
1
answer
94
views
Unclear how to include PyMySQL with RSA in requirements.txt or setup
Thanks for your work, working well..
I am able to install the rsa version with python3 -m pip install PyMySQL[rsa], but:
I don’t know how to specify rsa in a requirements.txt file
More seriously, I ...
0
votes
1
answer
76
views
pip install . only allows package to be imported when in the original directory
I have a package that I have built locally and I wish to distribute for use in another package. After pip install . I am able to import this package and run functions in Python, but only when in the ...
0
votes
1
answer
41
views
How to package root-level modules in namespace packages?
Consider this project structure:
<project root>
setup.py
<namespace_package>
module_a.py
module_b.py
<package>
__init__.py
The PyPA documentation suggests that ...
1
vote
0
answers
31
views
How to include local whl files within a packaged tar.gz?
I have a python project called hardware_tools that I am trying to build into a distributable. The project structure is similar to:
hardware_tools/
├─ support/
│ ├─ __init__.py
│ ├─ arena_api-2.3.3-...
0
votes
0
answers
17
views
What's the right syntax for specifying a local extras_require in a setup.py?
I am trying to install an optional extra package in my setup.py
setup.py
from setuptools import setup, find_packages
setup(
name="my_package",
version="0.1",
packages=...
0
votes
1
answer
277
views
SetuptoolsDeprecationWarning: setup.py install is deprecated
I'm getting this error while i'm trying to install a setup.py file using this command :
python setup.py install
Some people said downgrading Setuptools will solve this error so i tried to do that but ...
0
votes
1
answer
227
views
python scripts configured by pyproject.toml are not executable on MacOS
I have a python scripts package. Recently I changed setup.py to pyproject.toml to get rid of the alert from pip.
However, the installed scripts built by pyproject.toml work well on Windows platform, ...
0
votes
0
answers
36
views
How to access neighboring files from a setup.py when using "python -m build"?
Consider a Python project that uses setuptools for packaging and for some reason it needs a setup.py that contains certain dynamic logic at package build time. This setup.py needs to read a ...
0
votes
0
answers
45
views
Why does setup.py sometimes include 'post' in the generated package name?
I routinely build packages with the command python setup.py sdist. Sometimes the resulting package contains the suffix 'post' and sometimes it does not. Here's an example
-rw-r--r--. 1 sectools ...
0
votes
0
answers
122
views
How to create a required module directory structure in Python using pyproject.toml / setup.py?
My current project structure is as follows:
project
mod1
mod2
mod3
pyproject.toml
admin.py
I would like to come up with pyproject.toml in such a way that after doing a pip install . or ...
0
votes
1
answer
31
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 ...
1
vote
1
answer
57
views
ModuleNotFoundError when importing custom Python package from PyPI
I have been working on creating a custom Python package, "sumpackagesonar," and I am encountering an issue when trying to import it after installing it via PyPI. I have followed the ...
0
votes
0
answers
88
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 ...
2
votes
1
answer
5k
views
Why do I get a "No matching distribution found" error when installing a package I just uploaded to pypi?
I am trying to upload my package to PyPi. It uploads successfully every time but when I try to install it, I get the following error:
ERROR: Could not find a version that satisfies the requirement ...
0
votes
0
answers
45
views
`pip install` in a Conda environment does not produce an importable package?
I am trying to install spinningup inside a Conda environment, which is only currently available as a pip install (not a Conda package). The instructions specify to do a simple pip install:
git clone ...
0
votes
1
answer
51
views
Including setup.py in the wheel
The setup.py has the wheel version in it, and we would like to include it in the wheel to avoid need to type in new versions in multiple files in the project - e.g. in a version.py or __init__.py ...
0
votes
0
answers
26
views
List packages list from setup.py programmatically?
Given
setup(
packages=['foo', 'bar'],
...
)
Is there a way to get the packages list (for example with setuptools) without having to use regex?
3
votes
0
answers
83
views
local python files cannot be imported in setup.py
I have a Python project with a setup.py script in the root directory. I want to run a function from the inclider.py module before excecuting setuptools.setup().
│ inclider.py
│ pyproject.toml
│ ...
0
votes
0
answers
108
views
How do setup.py, setup.cfg, and pyproject.toml interact with conflicting configurations?
When using setuptools, I understand that I can use either setup.py with setup.cfg, pyproject.toml, or some combination of these. Many tutorials and references mention that configurations are merged ...
0
votes
0
answers
19
views
How can I correctly rebuild a Python library with C/CFFI components?
I am trying to work on a branch of a popular repository, which I link here: https://github.com/whatf0xx/pycryptodome/tree/undigest
As you can see, I have made 3 small commits so far, adding a C ...
0
votes
1
answer
22
views
setup.py won't catch the sphinx in the currently activated virtualenv
trying to build the docs for odoorpc 0.10.1
I checked out odoorpc to a local folder because the release available on Pypi is quite old
I installed it with
pip install ./
(./ is odoorpc)
According to ...
0
votes
1
answer
60
views
Import custom package into python package
I have a package, let's call it X (in a private gitlab repo).
I want to use that package inside other packages, for instance in package A.
This is the current setup.py of package A:
from setuptools ...
0
votes
2
answers
67
views
Installing a python script to run from the command line
I need to make some python utilities available to run from the command line (OSX Ventura). I've been looking over example and documentation for setup.py, but can't make any progress. Even with the ...
0
votes
0
answers
26
views
Cython Behavior difference setup.py develop vs setup.py install with shared object artifact
I noticed that setup.py develop will create the cython shared object (.so file) whereas setup.py install will not. Both will cythonize the .pyx file, but it seems only develop will generate the build ...