I’m trying to use Pyinstaller to make an exe of my python code to easily distribute. Every time I try run pyinstaller.py I get an error “[Errno 22] invalid mode (‘rb’) or filename: ””
I’ve seen a few other posts on this issue saying the problem is usually caused by hardcoding in filepaths for reading data, but all my filepaths are done using variables and asking the user where the files are located.
JavaScript
x
26
26
1
File "pyinstaller.py", line 18, in <module>
2
run()
3
File "PyInstaller-2.1PyInstaller-2.1PyInstallermain.py", line 88, in run
4
run_build(opts, spec_file, pyi_config)
5
File "PyInstaller-2.1PyInstaller-2.1PyInstallermain.py", line 46, in run_build
6
PyInstaller.build.main(pyi_config, spec_file, **opts.__dict__)
7
File "PyInstaller-2.1PyInstaller-2.1PyInstallerbuild.py", line 1924, in main
8
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
9
File "PyInstaller-2.1PyInstaller-2.1PyInstallerbuild.py", line 1873, in build
10
execfile(spec)
11
File "PyInstaller-2.1PyInstaller-2.1guimainguimain.spec", line 17, in <module>
12
console=True )
13
File "PyInstaller-2.1PyInstaller-2.1PyInstallerbuild.py", line 1170, in __init__
14
strip_binaries=self.strip, upx_binaries=self.upx,
15
File "PyInstaller-2.1PyInstaller-2.1PyInstallerbuild.py", line 1008, in __init__
16
self.__postinit__()
17
File "PyInstaller-2.1PyInstaller-2.1PyInstallerbuild.py", line 309, in __postinit__
18
self.assemble()
19
File "PyInstaller-2.1PyInstaller-2.1PyInstallerbuild.py", line 1050, in assemble
20
dist_nm=inm)
21
File "PyInstaller-2.1PyInstaller-2.1PyInstallerbuild.py", line 842, in checkCache
22
digest = cacheDigest(fnm)
23
File "PyInstaller-2.1PyInstaller-2.1PyInstallerbuild.py", line 796, in cacheDigest
24
data = open(fnm, "rb").read()
25
IOError: [Errno 22] invalid mode ('rb') or filename: ''
26
anyone have any ideas how I can start to fix this?
edit: Using version 2.1 of pyinstaller
edit: So I tried testing my code by creating this:
JavaScript
1
6
1
import pandas as pd
2
3
if __name__ == '__main__':
4
maindata = pd.DataFrame
5
print maindata
6
which is giving me the same error.
Advertisement
Answer
Well reinstalled pywin32 and now working :S just going go with it