码迷,mamicode.com
首页 > 编程语言 > 详细

python4delphi Python could not be properly initialized. We must quit.

时间:2016-01-06 19:52:26      阅读:439      评论:0      收藏:0      [点我收藏+]

标签:

要用32位的DLL,不要用64位的dll

Unable to load Python 2.7 dll with Delphi 2010 #6

 Closed
GoogleCodeExporter opened this issue on 24 Aug 2015 · 6 comments

1 participant

技术分享
技术分享
What steps will reproduce the problem?
1.Using Delphi 2010 install P4D from SVN (Python_2010.dproj)
2.Drop a PythonEngine VCL into a form
3.Modify the attribute to match 2.7 python version (DLLPATH: C:\python27, 
DLLNAME: python27.dll, RegVersion: 2.7 and uncheck UseLastKnownVersion )
4. Execute the application

What is the expected output? I expect to see the application running with an 
empty form.

What do you see instead?

---------------------------
Error
---------------------------
Error 193: Could not open Dll "python27.dll"
---------------------------
OK   
---------------------------

and after ...

---------------------------
Error
---------------------------
Python could not be properly initialized. We must quit.
---------------------------
OK   
---------------------------

Application just quit.


What version of the product are you using?
Delphi 2010 update 5

On what operating system?
Windows 7 x64



Original issue reported on code.google.com by elc...@gmail.com on 5 Sep 2010 at 6:08

Attachments:

技术分享
Are you sure your python27.dll is in the C:\python27 directory? In all user 
installations it is placed under c:\windows\system32.
In any case just leave the DLLPath blank, unless you use an unregistered 
version of Python.

Cannot reproduce here.

Original comment by pyscripter on 5 Sep 2010 at 7:56

  • Changed state: Invalid
技术分享
I‘ve copied the file from system32 to C:\python27 because it wasn‘t there ... 
even tried with the dll in the test application folder.... empty PATH or not it 
doesn‘t want to load any python dll. Have you tried with Windows 7 x64 ? 
Clearly there‘s something fishy with the method of loading the dll... maybe 
this has changed with the new OS.

Original comment by elc...@gmail.com on 5 Sep 2010 at 9:12

技术分享
Btw, i will make a video to show you later today.

Original comment by elc...@gmail.com on 5 Sep 2010 at 9:13

技术分享
Oh! Windows x64!  You need to install Python 32 bit since Delphi does not 
support x64 yet.

Original comment by pyscripter on 5 Sep 2010 at 9:40

技术分享
oh thanks i completely forgot this! I will try with python 32 bit :) thanks 
again!!

Original comment by elc...@gmail.com on 5 Sep 2010 at 9:42

技术分享
Thank you very much! It works with python 32 bit.
Also, it would be great to advise in your wiki about this issue. I know that we 
can‘t load 64 bit dlls with 32 bit application but i was focusing instead on 
your error code. The whole day i‘ve searched on google for :

 Error 193: Could not open Dll "python27.dll" or Python could not be properly initialized. We must quit.

It would be great to remind people that they might installed earlier before 
trying P4D, that a x64 version of python and is not compatible with delphi and 
p4d.

Wish you eternal success with P4D
have a nice day
laurent

Original comment by elc...@gmail.com on 5 Sep 2010 at 10:20

python4delphi Python could not be properly initialized. We must quit.

标签:

原文地址:http://www.cnblogs.com/h2zZhou/p/5106639.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!