我在Jupyter中制作了一个小程序,该程序使用以下库:
import pandas as pd
import datetime
#import pvlib forecast models
from pvlib.forecast import RAP
我在jupyter上做到了,它运行正常,但是我想有一个.exe,它将在输出CSV的控制台上运行,非常简单。问题是:
当我将其转换为.py时(它运行得很好),然后我使用pyinstaller创建一个可以在CMD上运行的.EXE并获取生成的CSV文件,但是,出现以下错误:
File "solar_FX_py.py", line 15, in
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "c:\users...\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.dict)
File "pvlib\forecast.py", line 5, in
from netCDF4 import num2date
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in load_unlocked
File "c:\users...\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.dict)
File "netCDF4_init.py", line 3, in
File "include\membuf.pyx", line 16, in init netCDF4._netCDF4
AttributeError: type object 'netCDF4._netCDF4._MemBuf' has no attribute 'reduce_cython'
我花了很多天试图解决此问题,但没有成功,我使用(可选)建议进行预测安装了pvlib,正如我所说,.py文件运行得很好,但是当我创建.py文件时。 exe文件没有。
是否可以解决此问题?还是有更好的方法来创建独立的应用程序?
谢谢!