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 1001
半阙折子戏
半阙折子戏 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:40

    For me this simple command solved the problem:

    sudo apt-get install postgresql postgresql-contrib libpq-dev python-dev
    

    Then I can do:

     pip install psycopg2
    

提交回复
热议问题