I am working on my first open source project.
While getting everything setup for the project, I followed the README.md step by step.
Now, I run into a problem. When I try to run a test and src scripts, I get the following error,
ImportError: No module named modules
Now, below is the file structure.
../
/modules
__init__.py
/src
lyrics.py
/tests
test_lyrics.py
lyrics.py import statements
import modules
def test_lyrics():
assert('lyrics' == modules.process_query('paradise lyrics')[0])
This is where the error "Import Error: modules not found".
Yes, all the requirements on the README were met.
If you want to take a look at the project, check it out on github.
Firstly, your directory tree should be rather like this:
../
/src
/modules
__init__.py
lyrics.py
/tests
test_lyrics.py
References
Then, as mentioned in the previous comments, if executing in the command line from the project root folder, set the PYTHONPATH environment variable
export PYTHONPATH=./src
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With