Jump to content
vmishka

Trouble installing Python4Delphi

Recommended Posts

I am having a great deal of difficulty installing Python4Delphi under Delphi 10.4 and I would appreciate some help. I watched Jim McKeeth's YouTube video "Getting Started with Python4Delphi" several times, but with all due respect to Jim, it didn't help me. People who ask basic installation questions want to know step-by-step instructions on how to proceed -- SLOWLY. The person doing the training should not assume that such a person has any knowledge of installing 3rd party components. It would seem that Jim's purpose is to show how quickly and easily he can do something since he already knows how to do it.

 

I used Delphi extensively years ago (huge project 20-25 years ago, smaller project 5 years ago) but didn't have the need to install many 3rd party components, and the ones I did install many years ago were not as complicated as this.

 

I have followed the installation instructions at https://github.com/pyscripter/python4delphi/wiki/Installation. I cloned the repo to D:\Components\P4D using "Git CMD" (not from within the Delphi IDE like Jim seemed to do on his video). I believe that step was successful.

 

Then, as instructed, I added the source subdirectories (D:\Components\P4D\Source, D:\Components\P4D\Source\vcl, and D:\Components\P4D\Source\fmx) to the IDE library path for Windows 64-bit (which is the target I intend to use when I write code). I did not add them to Windows 32-bit at first but did so later even though I only want to build Windows 64-bit programs.

 

As instructed, I found P4DComponentSuite.groupproj in my "D:\Components\P4D\Pacakges\Delphi\Delphi 10.4+" directory and opened it within the Delphi IDE (please see "IDE Screenshot). I believe that I am supposed to build the project at this point (and then perhaps Install?). However, when I right-clicked in the Projects area and chose "Build..." it failed with the error "Required Package DesignIDE not found." It looked to me like something was probably missing in my library path, so I searched my drive for "DesignIDE" and found designide270.bpl in the C:\Program Files (x86)\Embarcader\Studio\21.0\bin folder and designide.dcp in the \win32\release and \win32\debug folders. I am concerned that designide270 somehow refers to Python 2.7 which is not what I want, but that is the only designide*.bpl on my system. I have Python 3.9 on my system and all of the Python libraries that I will be using need Python 3. However, I added the bin, debug, and release folders to both my Windows 64-bit library path and my Windows 32-bit library path. To do it to the Windows 32-bit library path is very confusing to me. I want to build Windows 64-bit projects only.

 

Nothing changed if I try to Build using Windows 64-bit. Thinking that the Delphi IDE might be 32-bit and somehow I need to build this package under 32-bit, I tried that. When I try to build with a target of Windows 32-bit (the error changes to: "Can't load package Python$(Auto).bpl. The system cannot find the file specified." I don't understand the $(Auto) notation. I found Python270.bpl in my "C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl" folder and tried adding that directory to the 32-bit library path but I get the same error. Again, I am pretty sure that Python270 refers to Python 2.7 which is not what I want. I have run out of ideas.

 

Would someone familiar with installing Python4Delphi please be so kind as to "talk" me through click-by-click how to successfully install this package so that I can build Windows 64-bit programs where the Python part is Python 3?

 

Thank you.

IDE Screenshot.jpg

Share this post


Link to post
1 hour ago, vmishka said:

I did not add them to Windows 32-bit

The design time packages are 32-bit so you need to add the paths to the 32-bit target.

 

The group project contains runtime and designtime packages.

You first need to compile/build the runtime packages for target 32-bits. Optionally and only if you want to build 64-bit applications with runtime package, build 64-bit runtime packages:

- Python270.bpl

- PythonVcl270.bpl

- PythonFmx270.bpl

Then install the Design time packages (these are always 32-bits)

- dclPython270.bpl

- dclPythonVcl270.bpl

- dclPythonFmx270.bpl

Share this post


Link to post
1 hour ago, pyscripter said:

The design time packages are 32-bit so you need to add the paths to the 32-bit target.

 

The group project contains runtime and designtime packages.

You first need to compile/build the runtime packages for target 32-bits. Optionally and only if you want to build 64-bit applications with runtime package, build 64-bit runtime packages:

- Python270.bpl

- PythonVcl270.bpl

- PythonFmx270.bpl

Then install the Design time packages (these are always 32-bits)

- dclPython270.bpl

- dclPythonVcl270.bpl

- dclPythonFmx270.bpl

Thank you, pyscripter. I know that you are the developer and I have great respect for you. I don't want to waste your time, but I am not experienced enough in installing components to do this without click-by-click instructions. 

 

I added the folders that were mentioned in the installation wiki to the Windows 32-bit library path. I also added certain Embarcadero Studio folders to the path. Attached are screenshots of my library paths for both Windows 32-bit and Windows 64-bit.

 

I have the Python.dproj - Projects open "P4D ComponentSuite." (see screenshot) I completely removed the 64-bit targets at this point. Every target is Windows 32-bit. Whatever I try to build, e.g., right-click on P4D Component Suite and choose Build all... or right-click on the individual lines that do not contain "dcl" and choose "Build..." I get the same error, every time - "Can't load package Python$(Auto).bpl. The system cannot find the file specified." (Complete Build readout below).

 

At this point, the only specified .bpl file that is on my system is Python270.bpl in the "C:Users\Public\Documents\Embarcadero\Studio\21.0\Bpl" folder. (see screenshot, my search everything would find any file containing both Python and bpl).

 

Please tell me how to proceed step-by-step, click-by-click so that I can install your fine software. Assume that I know absolutely nothing about which files to build in what order, or how to install .bpl files (because in reality, I don't know those things).

 

Thank you.

 

Checking project dependencies...
Building Python.dproj (Debug, Win32)
brcc32 command line for "Python.vrc"
  c:\program files (x86)\embarcadero\studio\21.0\bin\cgrc.exe -c65001 "Python.vrc" -foPython.res 
dcc32 command line for "Python.dpk"
  c:\program files (x86)\embarcadero\studio\21.0\bin\dcc32.exe -$O- -$W+ --no-config -B -Q -TX.bpl -AGenerics.Collections=System.Generics.Collections;
  Generics.Defaults=System.Generics.Defaults;WinTypes=Winapi.Windows;WinProcs=Winapi.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -DDEBUG 
  -I"c:\program files (x86)\embarcadero\studio\21.0\lib\Win32\release";C:\Users\Lawrence\Documents\Embarcadero\Studio\21.0\Imports;"c:\program files 
  (x86)\embarcadero\studio\21.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp;"c:\program files (x86)\embarcadero\studio\21.0\include";
  C:\Users\Lawrence\Documents\Embarcadero\Studio\21.0\CatalogRepository\SynEdit-1.5-Sydney\source;D:\Components\P4D\Source;D:\Components\P4D\Source\vcl;
  D:\Components\P4D\Source\fmx;"C:\Program Files (x86)\Embarcadero\Studio\21.0\bin";"C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\win32\release";
  "C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\win32\debug";C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl 
  -LEC:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl -LNC:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp -NSData.Win;Datasnap.Win;Web.Win;
  Soap.Win;Xml.Win;Bde;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;DUnitX.Loggers.GUI;Winapi;System.Win; 
  -O"c:\program files (x86)\embarcadero\studio\21.0\lib\Win32\release";C:\Users\Lawrence\Documents\Embarcadero\Studio\21.0\Imports;"c:\program files 
  (x86)\embarcadero\studio\21.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp;"c:\program files (x86)\embarcadero\studio\21.0\include";
  C:\Users\Lawrence\Documents\Embarcadero\Studio\21.0\CatalogRepository\SynEdit-1.5-Sydney\source;D:\Components\P4D\Source;D:\Components\P4D\Source\vcl;
  D:\Components\P4D\Source\fmx;"C:\Program Files (x86)\Embarcadero\Studio\21.0\bin";"C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\win32\release";
  "C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\win32\debug";C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl -R"c:\program files 
  (x86)\embarcadero\studio\21.0\lib\Win32\release";C:\Users\Lawrence\Documents\Embarcadero\Studio\21.0\Imports;"c:\program files 
  (x86)\embarcadero\studio\21.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp;"c:\program files (x86)\embarcadero\studio\21.0\include";
  C:\Users\Lawrence\Documents\Embarcadero\Studio\21.0\CatalogRepository\SynEdit-1.5-Sydney\source;D:\Components\P4D\Source;D:\Components\P4D\Source\vcl;
  D:\Components\P4D\Source\fmx;"C:\Program Files (x86)\Embarcadero\Studio\21.0\bin";"C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\win32\release";
  "C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\win32\debug";C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl -U"c:\program files 
  (x86)\embarcadero\studio\21.0\lib\Win32\release";C:\Users\Lawrence\Documents\Embarcadero\Studio\21.0\Imports;"c:\program files 
  (x86)\embarcadero\studio\21.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp;"c:\program files (x86)\embarcadero\studio\21.0\include";
  C:\Users\Lawrence\Documents\Embarcadero\Studio\21.0\CatalogRepository\SynEdit-1.5-Sydney\source;D:\Components\P4D\Source;D:\Components\P4D\Source\vcl;
  D:\Components\P4D\Source\fmx;"C:\Program Files (x86)\Embarcadero\Studio\21.0\bin";"C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\win32\release";
  "C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\win32\debug";C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl -K00400000 
  --description:"Python4Delphi - Run-time Engine Package" -NBC:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp 
  -NHC:\Users\Public\Documents\Embarcadero\Studio\21.0\hpp\Win32  Python.dpk   
Can't load package Python$(Auto).bpl.
The system cannot find the file specified
[Fatal Error] Can't load package Python$(Auto).bpl.
The system cannot find the file specified

 

Python270.bpl is the only file of the six you mentioned that is on my system.jpg

IDE with Python.droj - Projects.jpg

Windows 64-bit library paths.jpg

Windows 32-bit library path.jpg

Edited by vmishka
Hit Submit Reply before I was ready

Share this post


Link to post

Thank you pyScripter. I really appreciate your help. I uninstalled 10.4 and installed 10.4.2. Then, I was able to open the groupproj, and with a target of Windows 32-bit, Build All successfully and install dclPython, dclPythonVcl, and dclPythonFmx. I will concentrate on looking at the demo projects.

 

To make doubly sure that I don't mess anything up in the future: To arrange to develop 64-bit Windows applications using Python4Delphi, I can go back to the groupproj, change the target to Windows 64-bit for Python270.bpl, PythonVcl270.bpl, and PythonFmx270.bpl and then build each of those individually (no Build All). If I understand correctly, if that is successful, I am good to go (nothing else to install). Is that correct?

 

Share this post


Link to post
Posted (edited)
18 hours ago, vmishka said:

To make doubly sure that I don't mess anything up in the future: To arrange to develop 64-bit Windows applications using Python4Delphi, I can go back to the groupproj, change the target to Windows 64-bit for Python270.bpl, PythonVcl270.bpl, and PythonFmx270.bpl and then build each of those individually (no Build All). If I understand correctly, if that is successful, I am good to go (nothing else to install). Is that correct?

No need for any of that, if you are not building applications with run-time packages and most likely you are not.  Just change the platform of your project to Win64 and build it.

Edited by pyscripter

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×