命令“python setup.py egg_info”失败,错误代码为pip install

时间:2018-05-28 15:39:02

标签: python pip

我未能安装我的要求

pip install -r requirements.txt
Collecting Flask==0.10.1 (from -r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/db/9c/149ba60c47d107f85fe52564133348458f093dd5e6b57a5b60ab9ac517bb/Flask-0.10.1.tar.gz
Collecting flask-sqlalchemy==1.0 (from -r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/d7/bc/c02a52b382519c1bbfaf872e311489be40a0d7212eb151c3470b44e6d6c4/Flask-SQLAlchemy-1.0.tar.gz
Collecting flask-migrate==1.2.0 (from -r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/3e/f6/3b96aa6beec503e8912df2f4c1c978603b234f673ba231026783adb2a96e/Flask-Migrate-1.2.0.tar.gz
Collecting psycopg2==2.5.4 (from -r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/63/c3/802668cb3cfc2880c2a8364623e7105a0257724a2612bb66ec733aaddb8c/psycopg2-2.5.4.tar.gz
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
    Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-s4tk6lod/psycopg2/

我可以用

安装python-psycopg2
apt-get python-psycopg2

,但后者我有导入问题

 ./manage.py db upgrade
  from flask.ext.sqlalchemy import SQLAlchemy
ModuleNotFoundError: No module named 'flask'

我使用venv作为虚拟环境。 为什么我的pip安装失败了?

0 个答案:

没有答案