I have an issue with pyinstaller and/or vpython. I’ve tried to boil
this down into the simplest code possible. Here is my python code:
import time
from vpython import *
def test2():
while True:
print ("Hello")
time.sleep(2)
if __name__ == "__main__":
test2()
When executing in
the Anaconda/Spyder environment everything works as expected.
However, after building a .exe with pyinstaller and
executing test2.exe it fails with the following error :
Traceback (most recent call last):
File "test2.py", line 10, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module
File "vpython\__init__.py", line 4, in <module>
File "vpython\gs_version.py", line 24, in glowscript_version
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Rick.PC-0XFZ\\Projects\\test2\\dist\\test2\\vpython\\vpython_libraries\\glow.min.js'
[8568] Failed to execute script test2
When I look at the path “C:
\\Users\\Rick.PC-0XFZ\\Projects\\test2\\dist\\test2\\vpython\\vpython” I see “
cyvector.cp38-win_amd64.pyd”, but no other files or directories. Specifically there is no “gs_version.py” file and no “vpython_libraries” directory.
Unfortunately I don’t know enough about .pyd files to understand the issue. And I’ve tried adding these directories to my sys.path but to no avail. Any suggestion or help is appreciated.
Thanks.