我需要将PostgreSQL从9.5版升级到11版。此后,当我从“ requirements.txt”文件重新创建virtualEnv时,在安装psycopg2软件包时开始出现以下错误:
Collecting psycopg2 == 2.6.2 (from -r conf/requirements.txt (line 50))
Using cached https://files.pythonhosted.org/packages/7b/a8/dc2d50a6f37c157459cd18bab381c8e6134b9381b50fbe969997b2ae7dbc/psycopg2-2.6.2.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 top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
Error: could not determine PostgreSQL version from '11 .1 '
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-0Q7bhV/psycopg2/
答案 0 :(得分:5)
经过研究,我运行了以下命令来尝试解决,但没有用:
sudo apt-get install postgresql-server-dev-all
sudo apt-get install postgresql-common
最后,我注意到psycopg2的2.6.2版本仅支持PostgreSQL的9.5版本。对于11,您应该使用最新版本的psycopg2,即版本2.7.7。在更改了requirements.txt文件之后,正确地重新创建了virtualEnv。
我希望它对其他人有用。
答案 1 :(得分:0)
选择此命令Python3-model(inputs.permute(0, 3, 1, 2))