程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> Delphi >> python4delphi import lxml pandas 出錯的小結,python4delphilxml

python4delphi import lxml pandas 出錯的小結,python4delphilxml

編輯:Delphi

python4delphi import lxml pandas 出錯的小結,python4delphilxml


環境:

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

               2.初始化dll失敗

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

 

解決:

1、lxml的問題用Anaconda-2.3.0-Windows-x86 裡面的lxml替換掉之後就解決了;

   估計是mvcrt90.dll的版本問題,兩個msvcr90.dll會造成初始化有問題

 

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問題

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved