ImportError: Couldn't import Django

前端 未结 22 1963
无人共我
无人共我 2020-12-05 01:59

I\'ve already configured virtualenv in pycharm, when using the python manage.py command, this is error shown:

E:\\video course\\Python\\code\\web_worker\\MxO         


        
22条回答
  •  误落风尘
    2020-12-05 02:39

    find your django parent dir path and add it to PYTHONPATH

    In my case, my django parent dir path is /Library/Python/3.7/site-packages,add this line into ~/.bash_profile

    export PYTHONPATH=/Library/Python/3.7/site-packages
    

    else if you have PYTHONPATH already, just append it like this

    export PYTHONPATH=${PYTHONPATH}:/Library/Python/3.7/site-packages
    

    then

    source ~/.bash_profile
    

提交回复
热议问题