I was working on my first django project using the documentation. I am getting this error while importing django modules. I'm sure that django is successfully installed in my virtual environment. The error is:
Unable to import 'django.shortcuts'
Unable to import 'django.http'
Unable to import 'django.contrib'
Unable to import 'django.urls'
If you look in your status bar you will notice you selected your global install of Python 3.7.4 and not a virtual environment. If you click on that you can then choose your virtual environment that you installed Django into.
You selected your global install of Python 3.7.4 and not a virtual environment. If you click on that you can then choose your virtual environment that you installed Django into.
Solution 2: (open VS Code from an activated virtual environment):
(this will ensure the VS Code process will inherit all of the Virtual Env environment settings)
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