Skip to main content
1 vote
1 answer
51 views

Python packaging: single-module with package data

I want to install my single file module together with its py.typed file using setuptools and pyproject.toml. I'm packaging a Python single-module, and so far I was using a very simple pyproject.toml: [...
2 votes
1 answer
98 views

My privately developed and installed module gives "ModuleNotFoundError: No module named 'jbpy'" at import

I'm implementing my own Python module package, called jbpy. I'm using setuptools with a pyproject.toml file as the build system. I'm working on Ubuntu 24.04, but I also get the error under WSL on a ...
Jens Bang's user avatar
0 votes
0 answers
71 views

Load Python module in Unbound DNS in Ubuntu 22.04

I have been trying to load Python module inside Unbound DNS. Following is the version list of the tools I am using:- Python: 3.10.12 Ubuntu: 22.04 Unbound DNS: 1.23.0 The unbound.conf contains ...
Krish Patel's user avatar
0 votes
0 answers
44 views

Use importlib.resources.files with no argument

I want to use importlib.resources.files to access a file from a module. According to the docs, If the anchor is omitted, the caller’s module is used. So I would assume something like import ...
502E532E's user avatar
  • 565
0 votes
1 answer
41 views

ModuleNotFoundError: No module named 'Teacher' in Python when importing from another folder

ModuleNotFoundError: No module named 'Teacher' even though the file exists I am trying to import a function from one Python file to another, but I keep getting the error: ModuleNotFoundError: No ...
Devang soni's user avatar
0 votes
1 answer
49 views

Anaconda Python3 virtual environment unable to recognise local modules

I'm reproducing a project code and trying to execute it locally. It uses Python 3.6 and old packages dating to 2017 and PIP struggles to install them and returned error codes which were 40 pages long. ...
SpaciousCoder78's user avatar
0 votes
0 answers
65 views

Import Helpers.py from different directory

I am making a React app. I am using some Python code to automate a few things. But currently I am duplicating some Python code across separate components. I would like to avoid this, and place all my ...
nbofni's user avatar
  • 47
0 votes
1 answer
71 views

Am I using a "backported module"?

I'm trying to use the Python vermin utility to determine the minimum version needed to run a script of mine. Running it, I get: $ vermin --no-parse-comments foo.py Tips: - You're using potentially ...
einpoklum's user avatar
  • 137k
0 votes
1 answer
57 views

Python 3 relative imports behave differently between local run and on k8s

I have the following structure: project/ |- src/ |- __init__.py |- package/ |- __init__.py |- module1.py |- module2.py Let's say module1.py ...
khteh's user avatar
  • 4,280
1 vote
2 answers
48 views

Executing & accessing python module code with __all__ in __init__.py

So I'm trying to write a simple wsgi python module where I use __init__.py to bring in variables & functions from another file but I can't seem to get the module to load. I keep getting the "...
Jeremy Daniel Gregorio's user avatar
0 votes
1 answer
36 views

Not able to use Smartsheet python api when packaging project using Nuitka

I wrote a python project that automates tasks and makes use of the smartsheet api but when I package this project into an executable with nuitka I get the error: ImportError! Could not load api or ...
Mariano Gongora's user avatar
2 votes
3 answers
89 views

How to "fold" python files used as modules into the main script file?

Suppose I have two Python script files: foo and utils/bar.py in some directory. In foo, I have: import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) from utils.bar import ...
einpoklum's user avatar
  • 137k
-1 votes
1 answer
142 views

What is the best way to manually install a python library?

I am currently creating a python library, and I want to find what is the best way for a user to install it on their computer. It is not distributed on Pypi (or Pypi test) for now, so I want them to ...
larticho's user avatar
  • 169
0 votes
1 answer
56 views

Docker python not able to recognize custom module

I have a project with the following structure: project/ checks/ __init__.py <some files here> engine/ __init__.py <some files here> models/ __init__.py <...
EntangledLabs's user avatar
-1 votes
1 answer
48 views

ModuleNotFoundError when referencing folder in Python [duplicate]

I have a Python3 project arranged as follows: C:\automation\framework\constants.py C:\automation\tests\unit-tests\test_myunittest.py In my unit test, I'm trying to call methods in framework folder, ...
bearaman's user avatar
  • 1,091

15 30 50 per page
1
2 3 4 5
139