Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Import "django.core.management" could not be resolved from sourcePylancereportMissingModuleSource

Im totaly green in python dev and i stuck on the beginning on tutorial.
I bought course to quickly learn how to make REST API in Python with Django and DjangoRestFramework.
At first attempt i stuck at the moment, where i creating first model because of error:

Import "django.db" could not be resolved from
sourcePylancereportMissingModuleSource

I have a lot of issues with PyCharm with Anaconda on my M1 MacOs, so i moved on to Visual Studio Code with extenstions to create a new project, but im currently stuck on this command:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

python3 manage.py startapp sue_api

It causes a error:

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?

I’ve installed Django and DjangoRestFramework using requirements.txt and command:

pip3 install -r requirements.txt

And all requirements are satisfied. So whats wrong there? Im in my created enviroment and have no idea what to do.

>Solution :

There error that you are getting indicates that Django is not installed yet. so first of all try django-admin command and see if the package is installed correctly.

if not then you have to install the package with pip or any package manager like poetry or pipenv or even install it directly from github page:

pip install Django

so check your requirements.txt and make sure django is there.

and also make sure you are using the same environment on pip3 and python3

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading