Traceback (most recent call last):
File "site-packages\pandas\__init__.py", line 26, in <module>
File "C:\Users\adas\AppData\Local\Continuum\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\pandas\_libs\__init__.py", line 4, in <module>
File "C:\Users\adas\AppData\Local\Continuum\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
module = loader.load_module(fullname)
File "pandas\_libs\tslibs\conversion.pxd", line 11, in init pandas._libs.tslib
File "C:\Users\adas\AppData\Local\Continuum\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
module = loader.load_module(fullname)
File "pandas\_libs\tslibs\conversion.pyx", line 1, in init pandas._libs.tslibs.conversion
ModuleNotFoundError: No module named 'pandas._libs.tslibs.np_datetime'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "fetchall2.py", line 5, in <module>
import pandas as pd
File "C:\Users\adas\AppData\Local\Continuum\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\pandas\__init__.py", line 35, in <module>
ImportError: C extension: No module named 'pandas._libs.tslibs.np_datetime' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
[283516] Failed to execute script fetchall2
I am trying to execute a python script i wrote. The script is supposed to create a PNG file based on the plot created by matplotlib. It works fine when I run it on the spyder IDE, but fails when I build it with PyInstaller.
using these imports
import MySQLdb
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Agg')
import pandas as pd
from sklearn.preprocessing import Imputer, LabelEncoder, OneHotEncoder, StandardScaler
from sklearn import svm
from sklearn.cross_validation import train_test_split
from sklearn.linear_model import LinearRegression
I tried to follow Petr Szturc's Method and created a hooks-pandas.py file and with hiddenimports = ['pandas._libs.tslibs.tslibs.np_datetime']
but continue to get the same traceback.
Anaconda 4.5.11
Python 3.6