Questions tagged [python-packaging]
Packages are namespaces which contain multiple packages and modules themselves.
659
questions
1
vote
0answers
10 views
Does pip offer any way for particular files within a package to be unaffected by new versions of the package?
I have never worked with pip before and I am trying to figure out if there is any way to have a particular file in a pip package I created never be overwritten when introduced to new package versions.
...
0
votes
0answers
13 views
Should I and how do I integrate pyenv, poetry, and docker?
Note: I have just started trying to learn docker, so I'm a beginner
Currently, I'm using poetry and pyenv to make my python project. I'm using pyenv for my python version, and poetry for creating and ...
0
votes
1answer
22 views
Setup python3.8, corresponding pip and virtualenv in ubuntu server via shell script
I am trying to build a python project in our Jenkins build server pulling the code from our git repo.
The project requires python3.8 and the latest pip version and virtualenv to be set up from scratch....
0
votes
0answers
26 views
Use flask/Dash functions in own package
I want to create my custom distribution package with a function which runs a Plotly dash app. This is how my code is structured:
project
│ setup.py
└───explorer
│ __init__.py
│ script.py
...
1
vote
1answer
20 views
How do I let pip to know to remove the systemd service file
In my python package I offer the user to run as a service and then install a .service file.
Is there a way to let pip know to remove it if the package is uninstalled ?
Thank you
2
votes
2answers
120 views
+50
Python import from submodule of package exported by another file
I have imports.py containing:
import os as exported_os
and foo.py containing:
from imports import exported_os
print(exported_os.path.devnull) # works
from imports.exported_os.path import devnull ...
2
votes
3answers
26 views
How to import a module, which imports another module, from two different folders inside a package
Assuming I have a python package with the following structure:
folder1
__init__.py
main.py
subfolder1
__init__.py
submain.py
subagent.py (contains class Agent)
...
1
vote
1answer
24 views
Python module with requirements from test repo
For some internal development I created a package that depends on another package that is currently under development.
I would like to add in my setup.py requirement for the test version of that ...
1
vote
3answers
98 views
Python 'requirements.txt' file in package
SITUATION:
I have created a python package where I use the following libraries:
matplotlib
regex
statistics
os
unittest
coverage
my problem is that when I do pip freeze, the result only returns
...
0
votes
1answer
35 views
Trying to publish a pypi distribution in python that relies on other pypi distribution
Im trying to publish a small distribution in python to pypi.
I'm following the docs https://packaging.python.org/tutorials/packaging-projects/
which specifies that i should have the following ...
-2
votes
1answer
33 views
Why does wheel installation put shared objects in site-packages folder instead of package folder?
I've a python binary distribution [wheel] created via
python setup.py bdist_wheel
The wheel looks as follows
unzip -l dist/<package-name>-1.0.0-cp36-cp36m-linux_x86_64.whl
Archive: dist/<...
0
votes
0answers
17 views
python setup.py install with setuptools and pbr fails with submodules
I have a git repo that contains one submodule. I run python setup.py install in the parent folder using prb and setuptools.
setup.py:
from setuptools import setup
setup(
setup_requires=['pbr','...
0
votes
0answers
17 views
Updating PYTHONPATH in setup.py
I have a Python package on GitHub. In all files and demos contained in the package, the imports are absolute, for example, with this folder structure:
package
+--- folder1
+--- +--- folder2
+--- +--- +...
0
votes
0answers
25 views
How to configure setup.py work with main method?
I made my tool executable and added __name__:main method which I want to give to my setup.py. This is what it looks like:
from setuptools import setup
setup(
name='client',
version='0.0.1',
...
-1
votes
0answers
12 views
Make a universal wheel file for a python package using nuitka
I have developed my own python package. Now I would like to distribute my package but without sharing the source code. After searching a lot I figured out that I can convert my source code to C and ...
0
votes
0answers
17 views
Error while importing external package to python script in azure ML designer
I'm trying to execute a Python script for linear programming that needs to import pulp package via python script bundle.
Below is the step performed by me:
downloaded pulp wheel file from https://...
1
vote
1answer
17 views
How to share package metadata between setup.py and application code?
A typical directory tree of a python project might look like this.
.
├── src
│ ├── __init__.py
│ ├── main.py
│ ├── module1
│ │ ├── __init__.py
│ │ └── foo.py
│ └── module2
│ ├── ...
0
votes
0answers
34 views
Include python packages from gitlab's package registry and other external indexes directly into setup.py dependencies
The gitlab package registry can be used to publish and install python packages. Such an installation works perfect using --extra-index-url or --index-url as described in the documentation and I have ...
0
votes
0answers
26 views
How can I setup imports for a top-level python package?
I have a directory structure set up like this:
top-package/
__init__.py
main.py
util.py
packageA/
__init__.py
aa.py
ab.py
packageB/
__init__.py
...
0
votes
1answer
14 views
Importing json resources inside .pex (Python Executable (format by Twitter))
I'm using a Twitter engineered build tool pants to manage many projects inside my monorepo. It outputs .pex files when I complete a build, this is a binary that packages the bare minimum dependencies ...
0
votes
0answers
26 views
How do I get packages/modules to work in Python 3.9.1 (Inter-package and out-of-package)
Anyone looking for the answer to this question: This answer worked perfectly!
I am making a program that will store X and Y coordinates for positioning on a target. I will then use it to calculate ...
0
votes
2answers
32 views
How to specify a minimum pip version with a dependency specification?
PEP 508 describes how to set additional specifications for dependencies. This can be used for example to specify that a dependency should only be installed on Linux systems.
Is there any way to use ...
-2
votes
0answers
19 views
Can't install cyvlfeat library on Python3.7
I am trying to install cyvlfeat library using '''pip install cyvlfeat''' command. It generates me error. I upgraded my pip. I doesn't work again.
Here is the error that I got:
C:\Python\Python37\...
0
votes
2answers
48 views
Get and install requirements.txt for python file into virtualenv
I have the following packages I need to install into my virtual environment for an app deployment. This is how they read at the top of my app's file:
import dash
import dash_core_components as dcc
...
0
votes
2answers
52 views
ModuleNotFoundError: cannot find my Python package
I have searched far and wide, and have followed just about everything... I cannot figure out why this keeps happening to my Python package I've created. It's not a simple "install dependency and ...
0
votes
1answer
50 views
Why pip install dependencies already installed?
I tied to install pyarrow on my macbook air with Apple Silicon. I currently use python 3.9.
I got an error when run pip install pyarrow.
(.venv) liyucheng@liyuchengdeMacBook-Air comments_generation % ...
0
votes
0answers
30 views
Pip install: url in requirement.txt make setup.py crashes [duplicate]
Currently doing a JetBrains Academy project, it added the following line to my requirement.txt file:
https://github.com/hyperskill/hs-test-python/archive/release.tar.gz
Works fine with pip, however, ...
1
vote
1answer
53 views
Why does python setup.py bdist_wheel creates a build folder?
I just learned to upload my own python packages to PyPI thanks to this amazing tutorial. I am trying now to better understand how wheels works and I found this article helpful.
However, I still do not ...
1
vote
1answer
37 views
Can I use attr: in description field of metadata in setup.cfg?
I try to use attr: in description but PyPi dispays attr: round_utils.__doc__ instead of value of that expression.
Docs says I cannot use attr: in description. Look at the Metadata table (link below):
...
0
votes
0answers
24 views
How to include non essential dependencies for a package release on PyPI or Conda?
I'm thinking about releasing one of my github projects as package to PyPI and Conda. It would be the first time for me to release something and I'm new to the process, naturally I have a lot of ...
0
votes
1answer
47 views
Publish Python Package via GitHub Actions to AWS CodeArtifact
I have a hard time to publish a package to AWS CodeArtifact. Problem is the authentification.
First I tried to execute the login via the aws cli but due to the lack of the .pypirc file containing the ...
1
vote
0answers
29 views
Pip resolution with extra-index
I am trying to set up a build pipeline with two python package repositories.
I'd like pip to first search in the public PyPi repos, and only if it cannot find a package or a version there, it should ...
-3
votes
0answers
27 views
I tried to install python library but getting error while installing it
I tried to install python package in visual studio code but getting error. Can anyone help to sought out my problem?
The error shown is-
ERROR: Command errored out with exit status 1:
command: 'c:...
0
votes
2answers
35 views
“ModuleNotFoundError” when importing modules inside package
I am trying to make my own package so that I can use the files in a different folder. This package contains a few different modules and then the main module that imports all the others inside it. For ...
0
votes
1answer
25 views
How to check compatibility of packages in setup.py wihout installation?
I use a setup.py to declare the python libraries to include in the package of my solution.
Is there a way to check the libraries compatibility using setup.py without installing the package? Because ...
0
votes
2answers
48 views
Python import or create package
i have a project structure like this:
python-modinfo
|--funcs
|--__init__.py
|--funcs.py
|--modules
|--File-Operations
|os_info.py
This is __init__.py:
from funcs.funcs import *
This ...
-1
votes
1answer
41 views
Incompatible version requirements when install package through pip
I have a conda environment. I want to install DeepSpeech in it. When I install it through pip I get an error, but the deepspeech package still gets installed.
ERROR: tensorflow 2.1.0 has requirement ...
-1
votes
0answers
20 views
setuptool/pip tries to access files not included in MANIFEST.in
I'm trying to install a Python project that includes a setup.py using pip install .. However, this fails because pip can't access certain files in a temporary build directory that my current user does ...
1
vote
0answers
55 views
How to pip-install ursina (or other Python libraries) on Raspberry PI 4 (Raspbian)? [closed]
When I use the pip command in Raspbian I get errors. I am trying to install the library ursina.
Could not find a version that satisfies the requirement panda3d (from ursina) (from versions: )
No ...
0
votes
0answers
42 views
word2vec installation Failed building wheel Could not build wheels for word2vec which use PEP 517 and cannot be installed directly
I'm trying to pip-install word2vec and I get these errors:
ERROR: Failed building wheel for word2vec
ERROR: Could not build wheels for word2vec which use PEP 517 and cannot be installed directly
1
vote
1answer
55 views
Python package: Stylesheet not loaded when launching script [duplicate]
I have a package with the following structure:
package
├── LICENSE
├── README.md
├── MANIFEST.in
├── my_pkg
│ └── __init__.py
│ └── main.py
│ └── style.qss
├── setup.py
When I install it from ...
0
votes
0answers
40 views
Equivalent of R packages automation tools in Python
I'm an R user. I'm used to, when creating a project in R, developing an R package. Simply because R packages have a standard structure of file organization, naming, conventions, etc... So that makes ...
1
vote
1answer
31 views
Python extension with multiple modules
I am building Python bindings for a standalone C library that I wrote. The file layout of the library is as following:
<project root>
|
`- cpython
| |
| `- module1_mod.c
| `- module2_mod.c
| ...
1
vote
1answer
24 views
self created module not callable
I am trying to create a python package so after creating the folder with all my files in it including a __init__.py file I moved the folder into /usr/local/lib/python3.8/site-packages/.
When I try to ...
1
vote
1answer
35 views
Can't Display Version of a Python Binary PEX with Click Entry Points
Python Click CLI Application
When you use a Click library to build a Python CLI Application you can do this:
@click.version_option()
def cli():
'''
Main Entry Point to Click Interface
'''
...
0
votes
0answers
32 views
How to handle when __file__ is None and __path__ is List[str] of duplicates in native namespace package
I am just converting a package to be compliant with PEP 420 namespace packaging.
One of the modules in the package pulls the __file__ attribute for the module foo.bar to ultimately get the foo.bar ...
0
votes
0answers
12 views
How to make my python sub-file see outside-file with import?
My python file tree looks like below.
Temp - temp.py
- Sub - see_out.py
temp.py
name = __name__
see_out.py
from Temp import temp
print(temp.name)
On pycharm, It works
Temp.temp
But on the ...
0
votes
2answers
48 views
In setup.py, how to run a system command before any pip install?
I am creating a Python package with setup.py, and I need to run certain shell commands before pip attempts to install dependencies. In fact, I need these commands to run before setuptools makes ...
0
votes
0answers
8 views
Import custom python package fails to laod dependencies
I am starting to learn how to create and import my custom made python packages and I am facing an error that I am not sure how to solve. Here is what I am doing:
I have the following folder mypackage ...
0
votes
0answers
17 views
Find python package documentation in Jupyter notebook
Is there a way to access python module / package documentation in jupyter notebook, similar to function documentations.
help(round), len? or ?len works. Looking for something like help(pandas)...