2016-12-03 2 views
2

で失敗しました私は評判のウェブホスティング会社の共有サーバー上で午前ここで私は上だLinuxのバージョンの詳細です。私はここにすべてのコマンドを追加していますので、ソリューションプロバイダは回答する前にすべての情報を持っています。SSHを使用して共有サーバー(Linux)にpsycopg2をインストールできません。 、というエラー:コマンド「gccの」終了ステータス1

$ uname -a 
Linux somehosting.com 2.6.32-673.8.1.lve1.4.3.el6.x86_64 #1 SMP Wed Feb 10 08:57:30 EST 2016 x86_64 x86_64 x86_64 GNU/Linux 

$ cat /proc/version 
Linux version 2.6.32-673.8.1.lve1.4.3.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)) #1 SMP Wed Feb 10 08:57:30 EST 2016 

$ cat /etc/*release* 
CloudLinux Server release 6.8 (Oleg Makarov) 
CloudLinux Server release 6.8 (Oleg Makarov) 
cpe:/o:redhat:enterprise_linux:6:ga:server 

私が達成しようとしていることは何ですか?

私のシステムにpsycopg2をインストールする必要があります。

私は今まで何をしていましたか?

oauth2clientにはPython 2.7またはPython 3+が必要ですが、共有ホスティングでPython 2.6が提供されました。今まで、私はPython 3.5.3とPipを共有サーバーにローカルにインストールしました。私は今の午前何ステップ

は今、私が直面していますどのような問題(システムの詳細は冒頭で言及されている)私のシステム上のソースを通じて

をpsycopg2をインストールするのですか?

問題を知るために、以下を参照してください。

[myname psycopg2-2.6.2]$ python setup.py install 
running install 
running bdist_egg 
running egg_info 
writing psycopg2.egg-info/PKG-INFO 
writing dependency_links to psycopg2.egg-info/dependency_links.txt 
writing top-level names to psycopg2.egg-info/top_level.txt 
reading manifest file 'psycopg2.egg-info/SOURCES.txt' 
reading manifest template 'MANIFEST.in' 
writing manifest file 'psycopg2.egg-info/SOURCES.txt' 
installing library code to build/bdist.linux-x86_64/egg 
running install_lib 
running build_py 
running build_ext 
building 'psycopg2._psycopg' extension 
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.2 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x09030F -DHAVE_LO64=1 -I/home/amanka5/python/Python-3.5.2/Include -I/home/amanka5/python/Python-3.5.2 -I. -I/usr/pgsql-9.3/include -I/usr/pgsql-9.3/include/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.5/psycopg/psycopgmodule.o -Wdeclaration-after-statement 
In file included from psycopg/psycopgmodule.c:27: 
./psycopg/psycopg.h:31:22: error: libpq-fe.h: No such file or directory 
In file included from psycopg/psycopgmodule.c:29: 
./psycopg/connection.h:98: error: expected specifier-qualifier-list before ‘PGconn’ 
./psycopg/connection.h:135: error: expected ‘)’ before ‘*’ token 
./psycopg/connection.h:137: error: expected ‘)’ before ‘*’ token 
./psycopg/connection.h:138: error: expected ‘)’ before ‘*’ token 
./psycopg/connection.h:142: error: expected declaration specifiers or ‘...’ before ‘PGconn’ 
In file included from psycopg/psycopgmodule.c:30: 
./psycopg/cursor.h:63: error: expected specifier-qualifier-list before ‘PGresult’ 
In file included from psycopg/psycopgmodule.c:31: 
./psycopg/green.h:63: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
In file included from psycopg/psycopgmodule.c:32: 
./psycopg/lobject.h:29:28: error: libpq/libpq-fs.h: No such file or directory 
In file included from psycopg/psycopgmodule.c:32: 
./psycopg/lobject.h:49: error: expected specifier-qualifier-list before ‘Oid’ 
./psycopg/lobject.h:55: error: expected declaration specifiers or ‘...’ before ‘Oid’ 
./psycopg/lobject.h:55: error: expected declaration specifiers or ‘...’ before ‘Oid’ 
In file included from psycopg/psycopgmodule.c:38: 
./psycopg/error.h:38: error: expected specifier-qualifier-list before ‘PGresult’ 
psycopg/psycopgmodule.c: In function ‘psyco_register_type’: 
psycopg/psycopgmodule.c:154: error: ‘cursorObject’ has no member named ‘string_types’ 
psycopg/psycopgmodule.c:161: error: ‘connectionObject’ has no member named ‘string_types’ 
psycopg/psycopgmodule.c: In function ‘psyco_libcrypto_threads_init’: 
psycopg/psycopgmodule.c:191: warning: implicit declaration of function ‘PQinitOpenSSL’ 
error: command 'gcc' failed with exit status 1 

私が探している回答は何ですか?

私はこのgccの問題を受けていますが、C言語の基本的なhello worldプログラムが完璧に出力されます。私はstackoverflow上でほとんどすべての答えをここに読んだが、どこにでも私の問題の答えを見つけることができませんでした。私はpipを使ってpsycopg2をインストールしようとしましたが、上記のエラーと同じエラーが出ます。だから、この問題の解決策は何ですか?私はそれを理解することができず、助けが必要です。 psycopg2がなければ、PostgreSQL v9.3データベースに接続することはできません。本当に悪いです。

いくつかの他の関連する詳細(マイgccのバージョン)

$ gcc -v 
Using built-in specs. 
Target: x86_64-redhat-linux 
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux 
Thread model: posix 
gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) 

答えて

1

ここでの問題は、コンパイルが欠落によりライブラリに失敗したということです:libpq-dev

あなたは、次のログ・メッセージでそれを見ることができます。

gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.2 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x09030F -DHAVE_LO64=1 -I/home/amanka5/python/Python-3.5.2/Include -I/home/amanka5/python/Python-3.5.2 -I. -I/usr/pgsql-9.3/include -I/usr/pgsql-9.3/include/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.5/psycopg/psycopgmodule.o -Wdeclaration-after-statement 
In file included from psycopg/psycopgmodule.c:27: 
./psycopg/psycopg.h:31:22: error: libpq-fe.h: No such file or directory 

あなたはPostgreSQLの開発者ライブラリをインストールする必要があることを修正するには。 RedhatのようなLinuxでは、パッケージはpostgresql-develと呼ばれています。次のコマンドは、不足しているライブラリをインストールします:

yum install postgresql-devel 
+0

はい、私はこれを実現しましたが、私の質問を書いている間に言及するのを忘れました。私は完全に私の問題に関連していなかった他のstackoverflow答えにこの解決策を見つけましたが、残念ながら、これは動作しません。以下のコードをご覧ください。私はこれにrootアクセスが必要です。これをインストールする他のオプションはありますか? '$ yum install postgresql-devel' 'ロードされたプラグイン:fastestmirror、rhnplugin、security *注意* CloudLinuxネットワークリポジトリは以下にリストされていません。 CLNリポジトリにアクセスするには、rootとしてこのコマンドを実行する必要があります。 このコマンドを実行するにはroot権限が必要です。 –

関連する問題