プログラミングのために Python と Oracle を接続するために cx_Oracle をインストールしました。ただし、cx_Oracle が存在するディレクトリにいる場合にのみ、cx_Oracle を Python にインポートできます。cx_Oracle をグローバルにインポートするにはどうすればよいですか? 以下は、問題を示すコードです。
ご協力いただきありがとうございます。
Python が cx_Oracle をインポートできない
user@T420 ~ $ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named cx_Oracle
Python は cx_Oracle が配置されているディレクトリから cx_Oracle をインポートできます
user@T420 /usr/lib/python2.7/site-packages $ ls
cx_Oracle-5.1.2-py2.7.egg-info cx_Oracle.so
user@T420 /usr/lib/python2.7/site-packages $ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>>