I compile using pyinstaller -F ./parser.spec
.
Then I run the program with ./dist/parser
and get this error:
Traceback (most recent call last):
File "<string>", line 21, in <module>
ImportError: No module named 'rethinkdb'
parser returned -1
I tried to create a hook file, but to be honest I really feel like I have no idea what I'm doing.
rethinkdb
is in hiddenimports
but pyparser
doesn't throw any errors at me indicating what might be wrong.
#!/usr/bin/env python
...
import rethinkdb
...
parser.spec
...
a = Analysis(
['parser'],
pathex=[os.path.realpath('./env/lib/python3.3/site-packages/')],
binaries=None,
datas=added_files,
hiddenimports=['rethinkdb'],
hookspath=[os.path.realpath('./hooks')],
runtime_hooks=None,
excludes=None,
win_no_prefer_redirects=None,
win_private_assemblies=None,
cipher=block_cipher
)
...
hooks/hook-rethinkdb.py
hiddenimports = [
'ssl',
'cPickle',
'pickle',
'itertools',
'multiprocessing',
'builtins',
'rethinkdb',
'rethinkdb.ast',
'rethinkdb.errors',
'rethinkdb.net',
'rethinkdb.ql2_pb2',
'rethinkdb.query',
'rethinkdb.version',
]