Discussion:
[pytables-users] pytables can't locate hdf5.dll when frozen using cx_freeze
Nick Williams
2015-07-15 19:49:41 UTC
Permalink
This issue sounds a lot like this one
<https://groups.google.com/d/topic/pytables-users/UkZfVcnUAu8/discussion>,
but the fixes made to pytables there don't work in this case.

I am using cx_freeze to package up my app. cx_freeze creates an EXE and a
ZIP with the required site-packages, including tables, in the distribution
folder. It also copies all required DLL's, including hdf5.dll and
python27.dll into the same folder as the EXE and ZIP. My app is called
IPQC.exe:

dist/IPQC.exe
dist/IPQC.zip
dist/IPQC.zip/tables
...
dist/hdf5.dll
...

When I freeze the application it runs fine on a PC with the same Python
distribution installed (specifically, Anaconda), but fails to run on a
different PC without Python.

Despite the comment on PyTables/__init__.py#L41
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L41>,
my frozen app does seem to have a __file__ attribute, which points inside
the ZIP file. So tables seems to only search these two explicit locations
for hdf5.dll:
dllpaths in PyTables/__init__.py#L38
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L38>:
('C:\\...\\Python\\pydcipqc\\IPQC\\dist\\IPQC.zip\\tables',
'\\Library\\bin'). The first doesn't contain the DLL. The second doesn't
exist.

I tried the following:

- Manually adding hdf5.dll to dist/IPQC.zip/tables, but that didn't work.
- Manually adding hdf5.dll to dist/Library/bin/ (which didn't previously
exist), but that didn't work.
- Explicitly adding the sys.executable path to my code prior to
importing tables, but that did not work (although it definitely ensured the
system path pulled in PyTables/__init__.py#L47
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L47> contained
the right folder)

However, if I explicitly add the sys.executable path to
PyTables/__init__.py#L38
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L38>:
dllpaths = (os.path.abspath(
os.path.dirname(__file__)), ) + (os.path.dirname(sys.
executable), ) + dllpaths

Everything works fine on all PCs, frozen, or not.

I am using Windows 8.1 64-bit with a 64-bit Python 2.7. Curiously I tried
the same cx_freeze routine on a different Windows 8.1 PC with 64 bit
Enthought Canopy python 2.7, and everything works fine without needing the
change listed above. I know for a fact there are some package version
differences between the two distributions, but both have pytables 3.2.0.

Thanks for any help,
Nick
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nick Williams
2015-07-15 19:55:39 UTC
Permalink
Sorry, forgot to include the traceback I get when running the frozen code,
without the fix:
Traceback (most recent call last):
File
"C:\Users\Nick\Anaconda\lib\site-packages\cx_Freeze\initscripts\Console.p
y", line 27, in <module>
File "IPQCController.py", line 1, in <module>
File "C:\Box Sync\Nick
Williams\Programming\Python\pydcipqc\IPQC\model\__init_
_.py", line 3, in <module>
File "C:\Box Sync\Nick
Williams\Programming\Python\pydcipqc\IPQC\model\data.py
", line 1, in <module>
File "C:\Users\Nick\Anaconda\lib\site-packages\tables\__init__.py", line
78, i
n <module>
ImportError: Could not load "hdf5.dll", please ensure that it can be found
in th
e system path
Post by Nick Williams
This issue sounds a lot like this one
<https://groups.google.com/d/topic/pytables-users/UkZfVcnUAu8/discussion>,
but the fixes made to pytables there don't work in this case.
I am using cx_freeze to package up my app. cx_freeze creates an EXE and a
ZIP with the required site-packages, including tables, in the distribution
folder. It also copies all required DLL's, including hdf5.dll and
python27.dll into the same folder as the EXE and ZIP. My app is called
dist/IPQC.exe
dist/IPQC.zip
dist/IPQC.zip/tables
...
dist/hdf5.dll
...
When I freeze the application it runs fine on a PC with the same Python
distribution installed (specifically, Anaconda), but fails to run on a
different PC without Python.
Despite the comment on PyTables/__init__.py#L41
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L41>,
my frozen app does seem to have a __file__ attribute, which points inside
the ZIP file. So tables seems to only search these two explicit locations
dllpaths in PyTables/__init__.py#L38
('C:\\...\\Python\\pydcipqc\\IPQC\\dist\\IPQC.zip\\tables',
'\\Library\\bin'). The first doesn't contain the DLL. The second doesn't
exist.
- Manually adding hdf5.dll to dist/IPQC.zip/tables, but that didn't work.
- Manually adding hdf5.dll to dist/Library/bin/ (which didn't
previously exist), but that didn't work.
- Explicitly adding the sys.executable path to my code prior to
importing tables, but that did not work (although it definitely ensured the
system path pulled in PyTables/__init__.py#L47
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L47> contained
the right folder)
However, if I explicitly add the sys.executable path to
PyTables/__init__.py#L38
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L38>
dllpaths = (os.path.abspath(
os.path.dirname(__file__)), ) + (os.path.dirname(sys.
executable), ) + dllpaths
Everything works fine on all PCs, frozen, or not.
I am using Windows 8.1 64-bit with a 64-bit Python 2.7. Curiously I tried
the same cx_freeze routine on a different Windows 8.1 PC with 64 bit
Enthought Canopy python 2.7, and everything works fine without needing the
change listed above. I know for a fact there are some package version
differences between the two distributions, but both have pytables 3.2.0.
Thanks for any help,
Nick
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
John David Reaver
2015-09-17 00:34:20 UTC
Permalink
Hey Nick, did you ever find a solution to this? I am coming across the
exact same issue.
Post by Nick Williams
Sorry, forgot to include the traceback I get when running the frozen code,
File
"C:\Users\Nick\Anaconda\lib\site-packages\cx_Freeze\initscripts\Console.p
y", line 27, in <module>
File "IPQCController.py", line 1, in <module>
File "C:\Box Sync\Nick
Williams\Programming\Python\pydcipqc\IPQC\model\__init_
_.py", line 3, in <module>
File "C:\Box Sync\Nick
Williams\Programming\Python\pydcipqc\IPQC\model\data.py
", line 1, in <module>
File "C:\Users\Nick\Anaconda\lib\site-packages\tables\__init__.py", line
78, i
n <module>
ImportError: Could not load "hdf5.dll", please ensure that it can be found
in th
e system path
Post by Nick Williams
This issue sounds a lot like this one
<https://groups.google.com/d/topic/pytables-users/UkZfVcnUAu8/discussion>,
but the fixes made to pytables there don't work in this case.
I am using cx_freeze to package up my app. cx_freeze creates an EXE and a
ZIP with the required site-packages, including tables, in the distribution
folder. It also copies all required DLL's, including hdf5.dll and
python27.dll into the same folder as the EXE and ZIP. My app is called
dist/IPQC.exe
dist/IPQC.zip
dist/IPQC.zip/tables
...
dist/hdf5.dll
...
When I freeze the application it runs fine on a PC with the same Python
distribution installed (specifically, Anaconda), but fails to run on a
different PC without Python.
Despite the comment on PyTables/__init__.py#L41
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L41>,
my frozen app does seem to have a __file__ attribute, which points inside
the ZIP file. So tables seems to only search these two explicit locations
dllpaths in PyTables/__init__.py#L38
('C:\\...\\Python\\pydcipqc\\IPQC\\dist\\IPQC.zip\\tables',
'\\Library\\bin'). The first doesn't contain the DLL. The second doesn't
exist.
- Manually adding hdf5.dll to dist/IPQC.zip/tables, but that didn't work.
- Manually adding hdf5.dll to dist/Library/bin/ (which didn't
previously exist), but that didn't work.
- Explicitly adding the sys.executable path to my code prior to
importing tables, but that did not work (although it definitely ensured the
system path pulled in PyTables/__init__.py#L47
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L47> contained
the right folder)
However, if I explicitly add the sys.executable path to
PyTables/__init__.py#L38
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L38>
dllpaths = (os.path.abspath(
os.path.dirname(__file__)), ) + (os.path.dirname(sys.
executable), ) + dllpaths
Everything works fine on all PCs, frozen, or not.
I am using Windows 8.1 64-bit with a 64-bit Python 2.7. Curiously I tried
the same cx_freeze routine on a different Windows 8.1 PC with 64 bit
Enthought Canopy python 2.7, and everything works fine without needing the
change listed above. I know for a fact there are some package version
differences between the two distributions, but both have pytables 3.2.0.
Thanks for any help,
Nick
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nick Williams
2015-10-05 16:18:23 UTC
Permalink
Nope, you're the first response. I just edit the pytables code as listed in
my post. It works every time, but I have to remember to make the change.

Nick
Post by John David Reaver
Hey Nick, did you ever find a solution to this? I am coming across the
exact same issue.
Post by Nick Williams
Sorry, forgot to include the traceback I get when running the frozen
File
"C:\Users\Nick\Anaconda\lib\site-packages\cx_Freeze\initscripts\Console.p
y", line 27, in <module>
File "IPQCController.py", line 1, in <module>
File "C:\Box Sync\Nick
Williams\Programming\Python\pydcipqc\IPQC\model\__init_
_.py", line 3, in <module>
File "C:\Box Sync\Nick
Williams\Programming\Python\pydcipqc\IPQC\model\data.py
", line 1, in <module>
File "C:\Users\Nick\Anaconda\lib\site-packages\tables\__init__.py",
line 78, i
n <module>
ImportError: Could not load "hdf5.dll", please ensure that it can be
found in th
e system path
Post by Nick Williams
This issue sounds a lot like this one
<https://groups.google.com/d/topic/pytables-users/UkZfVcnUAu8/discussion>,
but the fixes made to pytables there don't work in this case.
I am using cx_freeze to package up my app. cx_freeze creates an EXE and
a ZIP with the required site-packages, including tables, in the
distribution folder. It also copies all required DLL's, including hdf5.dll
and python27.dll into the same folder as the EXE and ZIP. My app is called
dist/IPQC.exe
dist/IPQC.zip
dist/IPQC.zip/tables
...
dist/hdf5.dll
...
When I freeze the application it runs fine on a PC with the same Python
distribution installed (specifically, Anaconda), but fails to run on a
different PC without Python.
Despite the comment on PyTables/__init__.py#L41
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L41>,
my frozen app does seem to have a __file__ attribute, which points inside
the ZIP file. So tables seems to only search these two explicit locations
dllpaths in PyTables/__init__.py#L38
('C:\\...\\Python\\pydcipqc\\IPQC\\dist\\IPQC.zip\\tables',
'\\Library\\bin'). The first doesn't contain the DLL. The second doesn't
exist.
- Manually adding hdf5.dll to dist/IPQC.zip/tables, but that didn't work.
- Manually adding hdf5.dll to dist/Library/bin/ (which didn't
previously exist), but that didn't work.
- Explicitly adding the sys.executable path to my code prior to
importing tables, but that did not work (although it definitely ensured the
system path pulled in PyTables/__init__.py#L47
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L47> contained
the right folder)
However, if I explicitly add the sys.executable path to
PyTables/__init__.py#L38
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L38>
dllpaths = (os.path.abspath(
os.path.dirname(__file__)), ) + (os.path.dirname(sys.
executable), ) + dllpaths
Everything works fine on all PCs, frozen, or not.
I am using Windows 8.1 64-bit with a 64-bit Python 2.7. Curiously I
tried the same cx_freeze routine on a different Windows 8.1 PC with 64 bit
Enthought Canopy python 2.7, and everything works fine without needing the
change listed above. I know for a fact there are some package version
differences between the two distributions, but both have pytables 3.2.0.
Thanks for any help,
Nick
--
You received this message because you are subscribed to a topic in the
Google Groups "pytables-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/pytables-users/m6hua7Wc0Gw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Gaëtan de Menten
2015-10-08 20:18:51 UTC
Permalink
This is an anaconda-specific bug (not present upstream)...
See
https://github.com/ContinuumIO/anaconda-issues/issues/444
Post by Nick Williams
Nope, you're the first response. I just edit the pytables code as listed
in my post. It works every time, but I have to remember to make the change.
Nick
Post by John David Reaver
Hey Nick, did you ever find a solution to this? I am coming across the
exact same issue.
Post by Nick Williams
Sorry, forgot to include the traceback I get when running the frozen
File
"C:\Users\Nick\Anaconda\lib\site-packages\cx_Freeze\initscripts\Console.p
y", line 27, in <module>
File "IPQCController.py", line 1, in <module>
File "C:\Box Sync\Nick
Williams\Programming\Python\pydcipqc\IPQC\model\__init_
_.py", line 3, in <module>
File "C:\Box Sync\Nick
Williams\Programming\Python\pydcipqc\IPQC\model\data.py
", line 1, in <module>
File "C:\Users\Nick\Anaconda\lib\site-packages\tables\__init__.py",
line 78, i
n <module>
ImportError: Could not load "hdf5.dll", please ensure that it can be
found in th
e system path
Post by Nick Williams
This issue sounds a lot like this one
<https://groups.google.com/d/topic/pytables-users/UkZfVcnUAu8/discussion>,
but the fixes made to pytables there don't work in this case.
I am using cx_freeze to package up my app. cx_freeze creates an EXE and
a ZIP with the required site-packages, including tables, in the
distribution folder. It also copies all required DLL's, including hdf5.dll
and python27.dll into the same folder as the EXE and ZIP. My app is called
dist/IPQC.exe
dist/IPQC.zip
dist/IPQC.zip/tables
...
dist/hdf5.dll
...
When I freeze the application it runs fine on a PC with the same Python
distribution installed (specifically, Anaconda), but fails to run on a
different PC without Python.
Despite the comment on PyTables/__init__.py#L41
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L41>,
my frozen app does seem to have a __file__ attribute, which points inside
the ZIP file. So tables seems to only search these two explicit locations
dllpaths in PyTables/__init__.py#L38
('C:\\...\\Python\\pydcipqc\\IPQC\\dist\\IPQC.zip\\tables',
'\\Library\\bin'). The first doesn't contain the DLL. The second doesn't
exist.
- Manually adding hdf5.dll to dist/IPQC.zip/tables, but that didn't work.
- Manually adding hdf5.dll to dist/Library/bin/ (which didn't
previously exist), but that didn't work.
- Explicitly adding the sys.executable path to my code prior to
importing tables, but that did not work (although it definitely ensured the
system path pulled in PyTables/__init__.py#L47
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L47> contained
the right folder)
However, if I explicitly add the sys.executable path to
PyTables/__init__.py#L38
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L38>
dllpaths = (os.path.abspath(
os.path.dirname(__file__)), ) + (os.path.dirname(sys.
executable), ) + dllpaths
Everything works fine on all PCs, frozen, or not.
I am using Windows 8.1 64-bit with a 64-bit Python 2.7. Curiously I
tried the same cx_freeze routine on a different Windows 8.1 PC with 64 bit
Enthought Canopy python 2.7, and everything works fine without needing the
change listed above. I know for a fact there are some package version
differences between the two distributions, but both have pytables 3.2.0.
Thanks for any help,
Nick
--
You received this message because you are subscribed to a topic in the
Google Groups "pytables-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/pytables-users/m6hua7Wc0Gw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nick Williams
2015-10-08 20:38:16 UTC
Permalink
Great. Thanks for confirming. As noted, the fix is easy, but good to know
it might be resolved soon.

Nick
Post by Gaëtan de Menten
This is an anaconda-specific bug (not present upstream)...
See
https://github.com/ContinuumIO/anaconda-issues/issues/444
Post by Nick Williams
Nope, you're the first response. I just edit the pytables code as listed
in my post. It works every time, but I have to remember to make the change.
Nick
Post by John David Reaver
Hey Nick, did you ever find a solution to this? I am coming across the
exact same issue.
Post by Nick Williams
Sorry, forgot to include the traceback I get when running the frozen
File
"C:\Users\Nick\Anaconda\lib\site-packages\cx_Freeze\initscripts\Console.p
y", line 27, in <module>
File "IPQCController.py", line 1, in <module>
File "C:\Box Sync\Nick
Williams\Programming\Python\pydcipqc\IPQC\model\__init_
_.py", line 3, in <module>
File "C:\Box Sync\Nick
Williams\Programming\Python\pydcipqc\IPQC\model\data.py
", line 1, in <module>
File "C:\Users\Nick\Anaconda\lib\site-packages\tables\__init__.py",
line 78, i
n <module>
ImportError: Could not load "hdf5.dll", please ensure that it can be
found in th
e system path
Post by Nick Williams
This issue sounds a lot like this one
<https://groups.google.com/d/topic/pytables-users/UkZfVcnUAu8/discussion>,
but the fixes made to pytables there don't work in this case.
I am using cx_freeze to package up my app. cx_freeze creates an EXE
and a ZIP with the required site-packages, including tables, in the
distribution folder. It also copies all required DLL's, including hdf5.dll
and python27.dll into the same folder as the EXE and ZIP. My app is called
dist/IPQC.exe
dist/IPQC.zip
dist/IPQC.zip/tables
...
dist/hdf5.dll
...
When I freeze the application it runs fine on a PC with the same
Python distribution installed (specifically, Anaconda), but fails to run on
a different PC without Python.
Despite the comment on PyTables/__init__.py#L41
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L41>,
my frozen app does seem to have a __file__ attribute, which points inside
the ZIP file. So tables seems to only search these two explicit locations
dllpaths in PyTables/__init__.py#L38
('C:\\...\\Python\\pydcipqc\\IPQC\\dist\\IPQC.zip\\tables',
'\\Library\\bin'). The first doesn't contain the DLL. The second doesn't
exist.
- Manually adding hdf5.dll to dist/IPQC.zip/tables, but that didn't work.
- Manually adding hdf5.dll to dist/Library/bin/ (which didn't
previously exist), but that didn't work.
- Explicitly adding the sys.executable path to my code prior to
importing tables, but that did not work (although it definitely ensured the
system path pulled in PyTables/__init__.py#L47
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L47> contained
the right folder)
However, if I explicitly add the sys.executable path to
PyTables/__init__.py#L38
<https://github.com/PyTables/PyTables/blob/develop/tables/__init__.py#L38>
dllpaths = (os.path.abspath(
os.path.dirname(__file__)), ) + (os.path.dirname(sys.
executable), ) + dllpaths
Everything works fine on all PCs, frozen, or not.
I am using Windows 8.1 64-bit with a 64-bit Python 2.7. Curiously I
tried the same cx_freeze routine on a different Windows 8.1 PC with 64 bit
Enthought Canopy python 2.7, and everything works fine without needing the
change listed above. I know for a fact there are some package version
differences between the two distributions, but both have pytables 3.2.0.
Thanks for any help,
Nick
--
You received this message because you are subscribed to a topic in the
Google Groups "pytables-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/pytables-users/m6hua7Wc0Gw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
Post by Nick Williams
"pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...