Gary Shelton
Gary Shelton

Reputation: 143

Delphi Can't load package the specified module cannot be found

Delphi 10.3 Windows 10

I am trying to install the TDataSet component for Advantage Database. I have already installed it to my laptop without any trouble. The laptop has the same systems.

On my desktop I get the error Can't load package... the specified module cannot be found.

I have searched for answers for hours. Others with the same problem have solved it with path adjustments. The modules do exist and are on the search path. I even added it to the system environment variable. That was not necessary on the laptop. There is only one .dcp package that is not a regular system file and it compiles to the standard Public\Embarcadero...\dcp directory.

After hours of searching I'm ready to give up. Any new ideas?

The required section contains:

adsd103Rio.dcp, //I triple checked the spelling
dcldb.dcp,
designide.dcp,
rtl.dcp,
vcl.dcp

Any new ideas? Gary

Upvotes: 5

Views: 18426

Answers (6)

IceCold
IceCold

Reputation: 21202

Sometimes when you right click a package and choose Install, you can get an “cannot load package error like the one below:

Can't load package MyPackage.bpl. The specified module could not be found.

These are the possible issues and solutions. Start in this order.

1. Check the BPL path
Make sure that the BPL output folder is correctly set. You can set this from the IDE, but I feel better if I check directly the registry:

Through this setting, you tell the compiler where to put the BPL files when you compile a package.

Here is the registry key:

Registry\HKEY_CURRENT_USER\Software\Embarcadero\BDS\xx.0\Library\Win32\Package DPL Output

Make sure that it points to the correct folder. The default folder for Delphi 11 is: []

2. Make sure your package was compiled
Check if the BPL was compiled and it is present in Delphi’s BPLs folder.

If it is not present, the problem could be in the DProj file. Make sure that in Project Options the Lib Suffix field is set correctly. My Delphi does not accept an underscore in this field: _$(Auto)

I find it strange that Delphi does not accept this and shows an erroneous error message.

Setting that field manually in the IDE, in "Project Options" will not help. I had to set that field to a random value ('x'), save the project, then open again the Project Options and put the field back to $(Auto). Then it worked. 3. Make sure your package is not “excluded”
Another corruption that could appear in the Dproj file: search the Excluded_Packages section in that file and remove your own package from there (if present):

<Excluded_Packages>
MyPackage.BPL // Remove this line
</Excluded_Packages>

PS: I discovered that it is enough to open Project Options and go to the "Excluded packages" tab. Then simply close the project options without making any changes. That will remove your package from “Excluded packages” section. Mysterious are Embarcadero's ways!

4. Dependency failure
In one instance my package required another package, but its BPL was not present. I used the Dependency scanner feature from 'PE Explorer' ( www.heaventools.de ) to detect this. There was supposed to be a free alternative from Microsoft called "Dependency walker" but it crashes. Notice that you will have to open all branches until you find a red dot like this: []

Once you find the missing BPL, bring it back to Delphi’s BPL folder (manually copy it there, or recompile its package).

enter image description here

Upvotes: 0

The .bpl files for Designtime package and Runtime package must be in the same folder (usually in \Users\Public\Documents\Embarcadero\Studio\xx.x\Bpl).

Upvotes: 0

Dmitry
Dmitry

Reputation: 51

copy all your components in below path: C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl

This advise has really solved problem on my side!

Upvotes: 2

Carlos Samaniego
Carlos Samaniego

Reputation: 11

Run as a administrator, it works for me.

Upvotes: 1

H.Saberi
H.Saberi

Reputation: 11

I had same issue. please copy all your components in below path: C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl

Upvotes: 0

Bret Bordwell
Bret Bordwell

Reputation: 89

i had same issue. spent hours on this. Here is the solution that worked for me:

go to this thread: Can't load package %s error while installing a package

Look for answer that starts with this:

Run Process Monitor from http://SysInternals.com and set the filters to intercept only file operations ( toolbar rightmost buttons ) of your Delphi IDE process (check the process name in TaskManager or shortcut properties (it is bds.exe for Delphi XE2), then add the filter similar to Include / Process Name / Ends With / bds.exe ).

Upvotes: 6

Related Questions