cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How can I fix "No module named 'api.neo4j'"?

Hi everyone,

Justin here.

I’m busy with Building Neo4j Applications with Python. I'm working in Windows. When I run the tests, I get this error: "ModuleNotFoundError: No module named 'api.neo4j'"

I've successfully installed all the modules in the requirements.txt. And I don't know what else I need to install to get this to work. I'd appreciate any help.

Thank you in advance.

1 ACCEPTED SOLUTION

This error happens when the current module isn't in the PYTHONPATH environment variable. To get around this I have added PYTHONPATH=. to the start of the command.

PYTHONPATH=. pytest tests/05_authentication__test.py

You could also run export PYTHONPATH=. in the terminal to apply it for that session.

View solution in original post

2 REPLIES 2

This error happens when the current module isn't in the PYTHONPATH environment variable. To get around this I have added PYTHONPATH=. to the start of the command.

PYTHONPATH=. pytest tests/05_authentication__test.py

You could also run export PYTHONPATH=. in the terminal to apply it for that session.

Thanks Adam! This seems to work. I appreciate the help.