Tôi cần cài đặt cx_Oracle cho Python 2.5 trên Linux (Linux 2.6.18-371.1.2.el5 i686). Tôi đã cài đặt Oracle client 10.2.0.4.cx_Oracle: distutils.errors.DistutilsSetupError: không thể định vị Oracle bao gồm các tệp
Tôi đã thử theo dõi: 1. Tải xuống cx_Oracle tar.gz
từ http://sourceforge.net/projects/cx-oracle/files/
. Tôi không biết phiên bản được liệt kê nào phù hợp với python 2.5 và Oracle client 10.2.0.4, vì vậy hãy thử cx_Oracle-5.1.tar.gz. Đã giải nén tar, chuyển đến thư mục chưa được giải nén và chạy cài đặt python setup.py. Tôi đã nhận lỗi: đường dẫn oracle
Traceback (most recent call last):
File "setup.py", line 187, in <module>
raise DistutilsSetupError("cannot locate Oracle include files")
distutils.errors.DistutilsSetupError: cannot locate Oracle include files
Trong .bash_profile Tôi đã setted:
export ORACLE_HOME=/usr/oracle/10.2.0.4/client
export PATH=$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
Làm thế nào khắc phục lỗi này, có lẽ tôi cần một phiên bản khác của cx_Oracle tar?
- Chạy pip install cx_Oracle. lỗi Got:
Downloading/giải nén cx-Oracle
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement cx-Oracle
No distributions at all found for cx-Oracle
Có thể ai đó tư vấn cho tôi giải pháp đúng?
Cập nhật Sau gợi ý trong phản ứng tôi đã nhận lỗi sau:
...
cx_Oracle.c:496: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
cx_Oracle.c:497: error: âOCI_UCBTYPE_EXITâ undeclared (first use in this function)
cx_Oracle.c:497: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
cx_Oracle.c:498: error: âOCI_UCBTYPE_REPLACEâ undeclared (first use in this function)
cx_Oracle.c:498: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
error: command 'gcc' failed with exit status 1
tôi đã cố gắng tạo liên kết tượng trưng, nó không giúp đỡ, nhưng tôi hãy thử thêm thư mục rỗng bao gồm trong /usr/oracle/10.2.0.4/client/net công việc. Lỗi này cố định, nhưng tôi mới, xin vui lòng xem trong câu hỏi cập nhật để biết chi tiết – khris
@khris Hãy thử tải về sdk và giải nén trên máy khách của bạn, nó sẽ tạo ra thư mục sdk/include. Tôi đã thêm liên kết vào câu trả lời. –
Bạn có thể cầu xin cho liên kết trực tiếp trong trang SDK khách hàng tôi thấy rất nhiều nội dung, như SDK quản lý nội dung và không biết chính xác tôi cần tải xuống gì. Cảm ơn – khris