我试图安装您Python2.6,但它失败。我不知道足够关于C或MS Vis。工作室的编译器,甚至种办法固定自己。

这是什么是输出的命令行:

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 文件中,我想我记得看到这样一个问题在其他地方,但是,我有四个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.

我猜这意味着它没有被正确地安装。如果有人能告诉我我做错了什么,那也将是一个完全可以接受的答案。

----------------------------- EDIT2-----------------------------

我已经检索 所有 文件从 Oracle的基本客户 版本11.1.0.7.我没有试图安装一个更大的客户。我下载了一个现在.

%ORACLE_HOME%=C:\Oracle\instantclient\ #The directory where the above files have been extracted.

更多信息

  • 当前的目录您的setup.py 是C:\pydev\cx_Oracle-5.0.1
  • 该版本的蟒蛇是2.6.3
  • 当前的目录是蟒蛇C:\Python26 --访问python2.6->类型py26的命令行,并将地图C:\python26\python
有帮助吗?

解决方案

你为什么不使用二进制包喜欢 窗户安装(Oracle10g,Python2.6)?

看看 http://cx-oracle.sourceforge.net/ 其他的二进制包


增编(要求):你必须确保使用您是:

  • 设置ORACLE_HOME如果这种环境变不存在(见本 Oracle常见问题)
  • 蟒蛇可以找到 oraocci11.dll Oracle11g, oraocci10.dll Oracle10g或 oraclient9.dll Oracle9i通过添加的文件夹(应%ORACLE_HOME%/bin)在DLL是在你的道路环境变量
  • 使用正确的二分包(即建立正确的蟒蛇/Oracle版本)

其他提示

你还需要一些类型的客户安装在计算机上,因为您是就之间的桥梁Python和Oracle的客户。有效Oracle的客户包括全Oracle安装(如标准或XE)或 即时的客户

自述:

请注意,一个Oracle的客户(或 服务器)需要安装在 为了使用您.如果你不 需要的工具来 完全客户安装这是 建议安装的即时 客户远远更容易安装。

我还没有安装在窗户前,但你可能已设置ORACLE_HOME环境可变因此,您知道在哪里看。

如果您使用的蟒蛇Python64,事情 容易:

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>

尝试运行蟒蛇提示作为管理:

enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top