2016-06-28 4 views
0

正しく動作するためには、psycopg2が必要なパッケージhgvsをインストールしようとしていました。次のエラーが発生するまでのインストール使用してPIPがスムーズ:EC2インスタンスにpsycopg2をインストールする際の問題

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libpq.a(fe-connect.o): unrecognized relocation (0x2a) in section `.text' 

/usr/bin/ld: final link failed: Bad value 

collect2: error: ld returned 1 exit status 

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 


---------------------------------------- 
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-ubuntu/psycopg2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-rh6BEQ-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-ubuntu/psycopg2 

同様のエラーが既に最新バージョン(2.7.4および9.5.3)にあるのpython-DEVとのlibpq-DEVを、インストールすることによって解決されました。 私はこれが果たしているどのくらいのインパクトの知らないが、須藤はapt-getをlibpqの-devのインストール実行している時に、私が手:

Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
libpq-dev is already the newest version (9.5.3-1). 
You might want to run 'apt-get -f install' to correct these: 
The following packages have unmet dependencies: 
apt-utils : Depends: libdb5.3 but it is not installable 
libapt-pkg5.0 : Breaks: libapt-inst1.5 (< 0.9.9~) but 0.9.7.7ubuntu6 is to be installed 
libc-bin : Depends: libc6 (< 2.18) but 2.21-7 is to be installed 
libc-dev-bin : Depends: libc6 (< 2.18) but 2.21-7 is to be installed 
libc6 : Breaks: libtirpc1 (< 0.2.3) but 0.2.2-5build1 is to be installed 
     Breaks: locales (< 2.21) but 2.13+git20120306-9 is to be installed 
libc6-dev : Depends: libc6 (= 2.17-0ubuntu5.1) but 2.21-7 is to be installed 
libpq-dev : Depends: libpq5 (= 9.5.3-1) but it is not installable 
libstdc++6 : Depends: gcc-5-base (= 5.3.1-7) but it is not installable 
      Breaks: python-scipy (<= 0.14.1-1) but 0.11.0+dfsg1-1ubuntu2 is to be installed 
      Breaks: python3-scipy (<= 0.14.1-1) but 0.11.0+dfsg1-1ubuntu2 is to be installed 
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

は、残念ながら、私が見つけた同様の質問には、魔法の1で対応してきましたいくつかの問題を解決したライン。これらの者のどれも働いておらず、問題の根底にある原因を説明するのにはあまり役立たなかった。誰かがそれを助けることができれば、それは非常に高く評価されるだろう。

答えて

0

使用この次のコマンドそれが動作します

sudo apt-get update 
sudo apt-get install -y build-essential 
sudo apt-get install -y python3.4-dev 
sudo apt-get install -y libpq-dev 

pip3 install psycopg2 
+0

'須藤はapt-getを-y python3.4-devの 読書パッケージのリストをインストール...状態情報を読み取る 建物の依存関係ツリー 完了...完了 E:パッケージpython3.4-devを見つけることができません E:glob 'python3.4-dev'でパッケージを見つけることができません E:regex 'python3.4-dev'によってパッケージを見つけることができません 現在、python 3.3がインストールされています。他のコマンドは、私のオリジナルの質問(2番目のコードブロック)のものに私に同様の警告を与えるにもかかわらず、私のパッケージが最新であることを返します。 –

+0

"python3.4-dev"を "python3-dev"に変更 – error2007s

+0

'python3はすでに最新バージョン(3.3.1-0ubuntu1)です。 これを修正するには、 'apt-get -f install'を実行するとよいでしょう: 以下のパッケージには、アンメットの依存関係があります:apt-utils:依存:libdb5.3しかし、インストールできません libapt-pkg5.0: -inst1.5(<0.9.9〜)0.9.7.7ubuntu6がインストールされます libc-bin:依存:libc6(<2.18)ですが、2.21-7がインストールされます ' アンインストールして再インストールしてください'' apt-get -f install ''を使って問題を引き起こしている依存関係はありますか? –

関連する問題