Pycharm error Django is not importable in this environment

前端 未结 17 1590
情话喂你
情话喂你 2021-02-01 13:00

I\'m getting the following errors in Pycharm.

Error: Django is not importable in this environment

It used to work well but I moved t

17条回答
  •  爱一瞬间的悲伤
    2021-02-01 13:09

    For people having selected a virtualenv/interpreter that HAS Django installed (but it might have changed python version since first selection...), and even re-installed Django, and still get this message, and slowly getting crazy: Hit File > Invalidate Caches / Restart ....

    This solved it for me.

    Also, keeping the list of available interpreters clean and correct always helps (on my linux, old interpreters of previous linux installations kept popping up...whaat), as well as not using special characters in virtualenv names (as was the OPs problem...see his answer).

提交回复
热议问题