使用以下csv文件csv file
import datetime
import pandas as pd
import numpy as np
# import xarray as xr
import holoviews as hv
import colorcet as cc
df = pd.read_csv('./grant.csv')
print(df.head())
df_2012 = df.loc[df['year']==2012, :].copy()
hv.Points(
data=df_2012,
kdims=['beak length (mm)', 'beak depth (mm)'],
vdims=['species'],
)
在使用以下命令创建exe后,我可以得到exe文件里面
pyinstaller grant.py
ls dist/grant/grant
在运行this exe时。/grant我收到以下错误
Traceback (most recent call last):
File "grant.py", line 7, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
File "holoviews/__init__.py", line 11, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
File "holoviews/util/__init__.py", line 15, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
File "holoviews/core/__init__.py", line 3, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
File "holoviews/core/boundingregion.py", line 12, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
File "holoviews/core/util.py", line 53, in <module>
File "packaging/version.py", line 266, in __init__
packaging.version.InvalidVersion: Invalid version: 'None'
[1396395] Failed to execute script 'grant' due to unhandled exception!
请在这方面给予帮助。
1条答案
按热度按时间ljsrvy3e1#
看起来您需要在pyinstaller命令中使用
param
包上的--collect-all
标志。例如:
或者,如果不想将
-F
编译为单个文件,也可以省略它。