zoukankan      html  css  js  c++  java
  • python4delphi import lxml pandas 出错的小结

    环境:

    1.win10 64位

    2.delphi xe8

    3.python2.7

    4.python4delphi  (svn 2015-03-21 发布的83版本号)

    5.lxml 3.4.4(通过pip 安装的)

    6.pandas 0.16.2

    错误现象:1.找不到指定的DLL

    QQ图片20150827132953

                   2.初始化dll失败

    QYXGO[S6UYQQ]C4Y401K}SC

                   3.ImportError: C extension: DLL load failed: 找不到指定的模块。

    [)6QEN~2$9X8OYD4ZSXB$NS

     

    解决:

    1、lxml的问题用Anaconda-2.3.0-Windows-x86 里面的lxml替换掉之后就解决了;

       估计是mvcrt90.dll的版本问题,两个msvcr90.dll会造成初始化有问题

    QQ图片20150827132700

    QQ图片20150827132723 

    2、pandas 的ImportError:C extension问题:

    pip has a --global-option flag

    You can use it to pass additional flags to build_ext.

    For instance, to add a -I flag:

    pip install --global-option=build_ext --global-option=--inplace --global-option="-Id:pandas" pandas

    Per-requirement Overrides

    Since version 7.0 pip supports controlling the command line options given to setup.py via requirements files. This disables the use of wheels (cached or otherwise) for that package, as setup.py does not exist for wheels.

    The --global-option and --install-option options are used to pass options to setup.py. For example:

    FooProject >= 1.2 --global-option="--no-user-cfg" 
                      --install-option="--prefix='/usr/local'" 
                      --install-option="--no-compile"
    

    The above translates roughly into running FooProject's setup.py script as:

    python setup.py --no-user-cfg install --prefix='/usr/local' --no-compile
    

    Note that the only way of giving more than one option to setup.py is through multiple --global-option and --install-option options, as shown in the example above. The value of each option is passed as a single argument to the setup.py script. Therefore, a line such as the following is invalid and would result in an installation error.

    # Invalid. Please use '--install-option' twice as shown above.
    FooProject >= 1.2 --install

    经测试上面的方法没有用。

     

    将生产的程序project4.exe复制到D:Anaconda文件夹下就没有报错了,不知道为什么

     

    python4delphi 调用Anaconda的python27.dll且路径里面只要包含Anaconda的Lib和DLLs就可以正常使用了,

    但是python27.dll换成原来装的python的就不行,一直报ImportError:C extension问题

     

    另外一个很重要的注意事项是版本问题,Python扩展包和Python的版本严格相关,不同版本的Python,其扩展包的版本也不同。
    最后一个注意事项是32位和64位不要搞混了,所有扩展包都分32位和64位两种版本。

  • 相关阅读:
    you must restart adb and eclipse的相关解决办法
    配有Tesla K40c的服务器新装Ubuntu16.04并安装CUDA8.0、Anaconda3、Matlab2016a、OPENCV3.1、CuDNN5.1、MXNet
    MXNet在64位Win7下的编译安装
    [Kinect]XBox One Kinect连接Windows
    64位Win7下编译Python3的计算机视觉库:OpenCV
    64位Win7下安装并配置Python3的深度学习库:Theano
    Noah的学习笔记之Python篇:命令行解析
    Noah的学习笔记之Python篇:函数“可变长参数”
    Noah的学习笔记之Python篇:装饰器
    linux下安装MySQL5.6记录
  • 原文地址:https://www.cnblogs.com/h2zZhou/p/4769023.html
Copyright © 2011-2022 走看看