Nick Williams
2015-07-15 19:49:41 UTC
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
<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.
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.