デフォルトでpython2.6.6がインストールされているLinux CENTOS 6.6サーバーがあります。
Python バージョン 2.7 が必要ですが、CENTOS 6.6 には、さまざまなシステム上の理由から、デフォルトの python2.6.6 インストールが必要です (yum は 2.6.6 に依存します)。
そのため、python 2.7 を別の場所 (/usr/local/lib/python2.7/) にインストールしました。現在、python2.6.6 で使用していたすべてのパッケージを 2.7 バージョンにインストールしようとしています。
次の.rpmファイルを使用してインストールされたpython2.6.6にmysql-connectorライブラリがインストールされています。
https://dev.mysql.com/doc/connector-python/en/connector-python-installation-binary.html
Installing Connector/Python on Linux Using an RPM Package
Connector/Python Linux RPM packages (.rpm files) are available from the Connector/Python download site (see Section 4.1, “Obtaining Connector/Python”).
To install a Connector/Python RPM package (denoted here as PACKAGE.rpm), use this command:
shell> rpm -i PACKAGE.rpm
To install the C Extension (available as of Connector/Python 2.1.1), install the corresponding package with “cext” in the package name.
RPM provides a feature to verify the integrity and authenticity of packages before installing them. To learn more, see Verifying Package Integrity Using MD5 Checksums or GnuPG.
python2.7 がインストールを認識するように mysql-connector ライブラリをインストールする方法がわかりません。
python2.6.6 の mysql-connector ライブラリに気付きました。(デフォルト) インストールは次の場所にあります。
/usr/lib/python2.6/site-packages/mysql/
/usr/lib/python2.6/site-packages/mysql_connector_python-1.1.5-py2.6.egg-info
mysqlディレクトリとegg-infoファイルをコピーして名前を変更するだけの解決策ですか、/usr/local/lib/python2.7/site-packages/
それとも従う必要がある追加/その他の手順がありますか。
mysql ディレクトリにはpython2.6.6 に固有のパスがあり、インストールプロセス中に構築される可能性が高いファイルが__init__.pyc
あるため、コピーがこの問題を解決するかどうかはわかりません。__init__.pyo