Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
OK, I have found the solution is to use sys.path.append. I am also thinking of using pyproject.toml.
-
The correct solution is to make it installable with a setup.py or a PEP 518 build system and then use `pip install -d .`.
-
atheist99013yI dunno, I think running tests shouldn't require the module to be installed (or on the path). You can however do relative imports that import from the parent directory.
https://stackoverflow.com/a/...
Related Rants
Hey everyone! I need your help!
So I am working on a game engine thingy called Polita. Now I want to import Polita's core module (`polita/polita.py`) into the `test/simple.py`, which contains a simple test (See the image). But when I tried to run `test/simple.py`, it saids `No module called 'polita'` (See the image) although I have added `__init__.py` to indicate that `polita` is a module.
Any ideas?
question
python