You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application

后端 未结 9 1019
半阙折子戏
半阙折子戏 2020-12-22 17:10

I am working on Django project with virtualenv and connect it to local postgres database. when i run the project is says,

ImportError: No module named psycop         


        
9条回答
  •  佛祖请我去吃肉
    2020-12-22 17:48

    I just run this command as a root from terminal and problem is solved,

    sudo apt-get install -y postgis postgresql-9.3-postgis-2.1
    pip install psycopg2
    

    or

    sudo apt-get install libpq-dev python-dev
    pip install psycopg2
    

提交回复
热议问题