ModuleNotFoundError: No module named 'django'
See original GitHub issueDescribe the bug
Fail to run ./run_tests.sh
with below error messages:
[+] Running 3/3
⠿ Container safe-transaction-service-ganache-1 Created 0.1s
⠿ Container safe-transaction-service-redis-1 Created 0.1s
⠿ Container safe-transaction-service-db-1 Created 0.1s
[+] Running 3/3
⠿ Container safe-transaction-service-redis-1 Started 0.6s
⠿ Container safe-transaction-service-db-1 Started 0.5s
⠿ Container safe-transaction-service-ganache-1 Started 0.5s
Traceback (most recent call last):
File "/home/liudan/safe-transaction-service/manage.py", line 10, in <module>
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/liudan/safe-transaction-service/manage.py", line 16, in <module>
import django # noqa
ModuleNotFoundError: No module named 'django'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/liudan/safe-transaction-service/manage.py", line 18, in <module>
raise ImportError(
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
To Reproduce Steps to reproduce the behavior:
source venv/bin/activate
pip install -r requirements-dev.txt
pre-commit install -f
cp .env.dev .env
sudo ./run_tests.sh
Expected behavior Should finished without error.
Environment (please complete the following information):
- OS: Ubuntu 22.04.01
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 9 months ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
ModuleNotFoundError: No module named 'django' in Python
The Python "ModuleNotFoundError: No module named 'django'" occurs when we forget to install the Django module before importing it or install it in...
Read more >ModuleNotFoundError: No module named 'django' - QueWorx
If you got the error “ModuleNotFoundError: No module named 'django'” it means that Python couldn't find your Django package. Here's the full error...
Read more >No module named django but it is installed - Stack Overflow
This error shows that Django is not installed. Installing Django should solve the problem. In my case, Django ...
Read more >ModuleNotFoundError: No Module Named Django
To resolve this error, you have to install Django. And, before installing Django must check Python is installed or not. If already installed ......
Read more >Resolve the “modulenotfounderror no module named 'django ...
The “modulenotfounderror no module named 'django'” problem is invoked when the package is not installed on your system or globally. It also occurs...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After put user to gourp docker, the test command
./run_tests.sh
can be executed successfully.Your user should have permissions for running docker, that’s related to your configuration, if you use
sudo
you are not using the virtualenv you created