Reputation: 1
I'm trying to bundle a ".py" file which contains simple cupy
code to ".exe" by pyinstaller
, but fail to open the ".exe" file.
Target Code:
import cupy as cp
a = cp.ones(3)
b = cp.ones(3) * 7
print(a+b)
I tried to revise hiddenimports
in ".spec" like:
hiddenimports=[
'C:\\Users\\Kevin\\miniconda3\\envs\\cupy_conda\\Lib\\site-packages\\cupy_backends\\cuda\\cuda\\cudnn.py',
'cupy',
'cupy_backends.cuda.api._runtime_enum',
'cupy_backends.cuda.stream',
'cupy_backends.cuda._softlink', #
'cupy._core._carray',
'fastrlock',
'fastrlock.rlock',
'cupy_backends.cuda.api._driver_enum',
'cupy._core._ufuncs',
'cupy._core._cub_reduction',
'cupy._core._routines_sorting',
'flags'
],
and bundle again.
(cupy_conda) PS C:\Users\Kevin\Downloads\plot> pyinstaller main.spec
Use cmd to execute the ".exe" file .
However, cmd output pyinstaller importerror: cannot import name flags
again.
Do I use the wrong way to bundle cupy
code?
Or how to fix it?
Upvotes: 0
Views: 295