Hey!
After many attempts, I was unable to package a project containing pyopencl
into a self-contained executable using cxfreeze. It gives me the error:
===============
File
"/usr/local/lib/python2.7/dist-packages/cx_Freeze/initscripts/Console.py",
line 27, in <module>
exec(code, m.__dict__)
File "test.py", line 4, in <module>
import pyopencl
File "/usr/local/lib/python2.7/dist-packages/pyopencl/__init__.py", line
79, in <module>
_DEFAULT_INCLUDE_OPTIONS = ["-I", _find_pyopencl_include_path()]
File "/usr/local/lib/python2.7/dist-packages/pyopencl/__init__.py", line
71, in _find_pyopencl_include_path
return resource_filename(Requirement.parse("pyopencl"), "pyopencl/cl")
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 949,
in resource_filename
return get_provider(package_or_requirement).get_resource_filename(
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 212,
in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 741,
in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 626,
in resolve
raise DistributionNotFound(req)
===================
This is what I get when embedding the simple python line
"import pyopencl"
Into an executable. All the other packages on which pyopencl depend cause
no issue. The error can be solved by manually copying
/usr/local/lib/python2.7/dist-packages/pyopencl-2014.1-py2.7.egg-info/
Into the folder which contains the executable generated by cxfreeze, but
this seems extremely hackish to me. Changing
/usr/local/lib/python2.7/dist-packages/pyopencl/__init__.py:_find_pyopencl_include_path()
to make it return '' also solves the issue. Both fixes look pretty hackish
to me, but I have no other idea of how to properly solve it.
The issue is simple to reproduce
pip install cxfreeze
cd /tmp
echo "import pyopencl" > test.py
cxfreeze test.py
./dist/test
Any idea?
Best regards,
Philippe
_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl