I have a simple python script that imports couchbase module on Ubuntu 14.04:
$ cat test.py
from couchbase import Couchbase
print 'module _libcouchbase found'
Running from interpreter works fine:
$ python test.py
module _libcouchbase found
Created an executable:
$ pyinstaller test.py
Running the executable throws an error of unable to import _libcouchbase module:
$ ./dist/test/test
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "/home/subba/cb/build/cb/out00-PYZ.pyz/mycouch", line 28, in <module>
File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "/home/subba/cb/build/cb/out00-PYZ.pyz/couchbase", line 28, in <module>
File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "/home/subba/cb/build/cb/out00-PYZ.pyz/couchbase.user_constants", line 21, in <module>
File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "/home/subba/cb/build/cb/out00-PYZ.pyz/couchbase._bootstrap", line 34, in <module>
File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "/home/subba/cb/build/cb/out00-PYZ.pyz/couchbase.exceptions", line 18, in <module>
ImportError: No module named _libcouchbase
It seems very mysterious. Thanks for any thoughts on why this happens!