문제
Python 2.6 용 CX_Oracle을 설치하려고하지만 실패합니다. 나는 C 또는 MS VIT에 대해 충분히 모른다. 스튜디오의 컴파일러는 심지어 직접 고정하는 데 접근합니다.
이것은 명령 줄에서 출력입니다.
C:\pydev\cx_Oracle-5.0.1>C:\python26\python setup.py install
running install
running build
running build_ext
building 'cx_Oracle' extension
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Oracle\instantclient\sdk\include -IC:\p
ython26\include -IC:\python26\PC /Tccx_Oracle.c /Fobuild\temp.win32-2.6-11g\Release\cx_Oracle.obj -DBUILD_VERSION=5.0.1
cx_Oracle.c
c:\pydev\cx_oracle-5.0.1\StringVar.c(392) : warning C4018: '>' : signed/unsigned mismatch
c:\pydev\cx_oracle-5.0.1\StringVar.c(417) : warning C4018: '>' : signed/unsigned mismatch
c:\pydev\cx_oracle-5.0.1\ObjectVar.c(117) : warning C4018: '<' : signed/unsigned mismatch
c:\pydev\cx_oracle-5.0.1\ObjectVar.c(134) : warning C4018: '<' : signed/unsigned mismatch
c:\pydev\cx_oracle-5.0.1\Variable.c(331) : error C2036: 'void *' : unknown size
c:\pydev\cx_oracle-5.0.1\Variable.c(878) : warning C4244: '=' : conversion from 'sb2' to 'sb1', possible loss of data
c:\pydev\cx_oracle-5.0.1\Variable.c(914) : warning C4018: '<' : signed/unsigned mismatch
error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit status 2
누구 든지이 문제를 해결하는 방법이 있습니까? (또한 해당 CL.Exe 파일에 문제가있을 수 있습니다. 나는 이것을 다른 곳에서 문제로 본 것을 기억하지만, 거기에 문제가있을 수있는 4 개의 Windows 머신이 있습니다.)
----------------------------- 편집하다 -------------------- --------
사전 컴파일 된 설치 프로그램을 사용하지 않는 이유는 모듈을 실행하려고 할 때 다음을 가져 오기 때문입니다.
Python 2.6.3 (r263rc1:75186, Oct 2 2009, 20:40:30) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import cx_Oracle Traceback (most recent call last): File "", line 1, in ImportError: DLL load failed: The specified module could not be found.
나는 그것이 제대로 설치되지 않았다는 것을 의미한다고 가정합니다. 누군가 내가 여기서 내가 무엇을 잘못했는지 말해 줄 수 있다면, 그것은 또한 완벽하게 받아 들일 수있는 대답이 될 것입니다.
------------------------------------------------------- --------
나는 검색했다 모두 파일 Oracle의 기본 클라이언트 버전 11.1.0.7. 더 실질적인 클라이언트를 설치하려고 시도하지 않았습니다. 나는 지금 하나를 다운로드하고있다.
%ORACLE_HOME%=C:\Oracle\instantclient\ #The directory where the above files have been extracted.
추가 정보
- cx_oracle의 setup.py의 현재 디렉토리는 c : pydev cx_oracle-5.0.1입니다.
- 파이썬의 버전은 2.6.3입니다
- Python의 현재 디렉토리는 C : Python26입니다 -Python 2.6-> 명령 줄에서 Py26을 입력하면 C : Python26 Python에 매핑됩니다.
해결책
왜 이진 패키지를 사용하지 않겠습니까? Windows 설치 프로그램 (Oracle 10G, Python 2.6)?
보다 http://cx-oracle.sourceforge.net/ 다른 바이너리 패키지의 경우
부록 (요청 된대로) : cx_oracle을 사용해야합니다.
- 이 환경 변수가 존재하지 않는 경우 oracle_home을 설정하십시오 (이 참조 오라클 FAQ)
- 파이썬이 찾을 수 있습니다
oraocci11.dll
Oracle 11g의 경우oraocci10.dll
Oracle 10g 또는oraclient9.dll
DLL이 경로 환경 변수에있는 폴더를 추가하여 Oracle 9i의 경우 ( %Oracle_Home %/bin) - 올바른 바이너리 패키지를 사용하십시오 (즉, 올바른 파이썬/오라클 버전 용으로 제작)
다른 팁
CX_ORACLE는 Python과 Oracle 클라이언트 사이의 브리지이기 때문에 컴퓨터에 일부 유형의 Oracle 클라이언트가 설치해야합니다. 유효한 Oracle 클라이언에는 전체 Oracle 설치 (표준 또는 XE 등) 또는 인스턴트 클라이언트
로부터 readme:
CX_ORACLE를 사용하려면 Oracle Client (또는 서버) 설치가 필요합니다. 전체 클라이언트 설치와 함께 제공되는 도구가 필요하지 않은 경우 설치가 훨씬 쉬운 인스턴트 클라이언트를 설치하는 것이 좋습니다.
이전에 Windows에 설치되지 않았지만 CX_ORACLE가 어디에서 볼지 알 수 있도록 Oracle_Home 환경 변수를 설정해야 할 수도 있습니다.
Anaconda Python X64를 사용하는 경우 상황이 있습니다 더 쉬운:
conda install -c https://conda.anaconda.org/anaconda cx_oracle
(오른쪽 Oracle 클라이언트를 설치합니다)
다음 오류가 발생하면 :
[Anaconda2] C:\Users\User>conda install -c https://conda.anaconda.org/anaconda c
x_oracle
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: .................
Package plan for installation in environment C:\Anaconda2:
The following NEW packages will be INSTALLED:
cx_oracle: 5.1.2-py27_0
oracle-instantclient: 11.2.0.4.0-0
The following packages will be UPDATED:
conda: 3.19.1-py27_0 --> 4.0.5-py27_0
pip: 8.0.2-py27_0 --> 8.1.1-py27_0
pyyaml: 3.11-py27_2 --> 3.11-py27_3
setuptools: 19.6.2-py27_0 --> 20.3-py27_0
wheel: 0.26.0-py27_1 --> 0.29.0-py27_0
Proceed ([y]/n)? y
Unlinking packages ...
An unexpected error has occurred, please consider sending the | 0%
following traceback to the conda GitHub issue tracker at:
https://github.com/conda/conda/issues
Include the output of the command 'conda info' in your report.
Traceback (most recent call last):
File "C:\Anaconda2\Scripts\conda-script.py", line 4, in <module>
sys.exit(main())
File "C:\Anaconda2\lib\site-packages\conda\cli\main.py", line 173, in main
args_func(args, p)
File "C:\Anaconda2\lib\site-packages\conda\cli\main.py", line 180, in args_fun
c
args.func(args, p)
File "C:\Anaconda2\lib\site-packages\conda\cli\main_install.py", line 45, in e
xecute
install.install(args, parser, 'install')
File "C:\Anaconda2\lib\site-packages\conda\cli\install.py", line 423, in insta
ll
plan.execute_actions(actions, index, verbose=not args.quiet)
File "C:\Anaconda2\lib\site-packages\conda\plan.py", line 538, in execute_acti
ons
inst.execute_instructions(plan, index, verbose)
File "C:\Anaconda2\lib\site-packages\conda\instructions.py", line 148, in exec
ute_instructions
cmd(state, arg)
File "C:\Anaconda2\lib\site-packages\conda\instructions.py", line 95, in UNLIN
K_CMD
install.unlink(state['prefix'], arg)
File "C:\Anaconda2\lib\site-packages\conda\install.py", line 714, in unlink
os.unlink(meta_path)
WindowsError: [Error 5] Access is denied: 'C:\\Anaconda2\\conda-meta\\conda-3.19
.1-py27_0.json'
[Anaconda2] C:\Users\User>
Anaconda 프롬프트를 관리자로 실행 해보십시오.