简体   繁体   中英

how to move an existing django project to pycharm

tutorial --- venv --- lib --- include --- bin --- first --- manage.py

my problem is , trying to open in pychrem and when i try to run the manage.py i have this error. in terminal evreything work , but in pychrem not .

/usr/local/bin/python3.8 /Users/alekseyzgeria/Desktop/tutorial/manage.py
Traceback (most recent call last):
  File "/Users/alekseyzgeria/Desktop/tutorial/manage.py", line 11, in main
from django.core.management import execute_from_command_line

ModuleNotFoundError: No module named 'django'


**The above exception was the direct cause of the following exception:**

File "/Users/alekseyzgeria/Desktop/tutorial/manage.py", line 22, in <module>
main()


 File "/Users/alekseyzgeria/Desktop/tutorial/manage.py", line 13, in main
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?

只需转到您的命令行并键入以下内容:

pip install django

You may have been running your Django project through a virtual environment, you could either download the framework to your main Python environment by running "pip install Django" in your terminal and continue your work however you could also locate your previous virtual environment and activate it by navigating to the venv directory (On Windows it should be your user folder) and running the activate script and then work from there. (If Django wasn't installed on that environment either run the same pip command from earlier)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM