trouble with python manage.py migrate -> No module named psycopg2

前端 未结 3 860
慢半拍i
慢半拍i 2021-01-19 06:25

I am having some trouble with migrating Django using postgresql.

This is my first time with Django, and I am just following the tutorial.

As suggested on the

3条回答
  •  借酒劲吻你
    2021-01-19 06:55

    It's because you use Django in a python virtualenv and as stated on virtualenv web site :

    It creates an environment that has its own installation directories, that doesn’t share libraries with other virtualenv environments (and optionally doesn’t access the globally installed libraries either).

    That means that you need to install psycopg2 in your virtualenv and not globaly or make it access globaly installed libraries.

提交回复
热议问题