diegohaz / rest

REST API generator with Node.js, Express and Mongoose
MIT License
1.79k stars 312 forks source link

ImportError : Couldn't import Django #267

Closed RENJITHVS closed 3 years ago

RENJITHVS commented 3 years ago

I have installed django==3.1.4 and activated Venv on my windows machine and it works fine in myBlog project. But today when I try to run the server, got this 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?

but venv is already activated and when I do pip freeze > requirements.txt

It shows

asgiref==3.3.4,
Django==3.1.4,
django-crispy-forms==1.11.2,
Pillow==8.2.0,
pytz==2021.1,
sqlparse==0.4.1,

I also checked sys.path, It shows

['', 'C:\Users\user\AppData\Local\Programs\Python\Python38-32\python38.zip', 'C:\Users\user\AppData\Local\Programs\Python\Python38-32\DLLs', 'C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib', 'C:\Users\user\AppData\Local\Programs\Python\Python38-32', 'C:\Users\user\Desktop\myBlog\venv', 'C:\Users\user\Desktop\myBlog\venv\lib\site-packages']

Please Help to fix this