New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'pandas._libs.tslibs.timedeltas' #2999

Closed
su79eu7k opened this Issue Nov 14, 2017 · 8 comments

Comments

Projects
None yet
7 participants
@su79eu7k

su79eu7k commented Nov 14, 2017

Thank you for the great library and all of your effort.

I've encountered unfamiliar error with pandas and I'm using below two libraries only. pyinstaller worked well with pandas before as I remember. Any idea or suggestion will be my appreciation. Thank you.

[Environment]

windows 7
python=3.5 (conda env)

[Library]

pandas 0.21.0 py35h0510043_1
PyInstaller 3.3

[ERROR while EXE file execution]

...
File "pandas/_libs/tslib.pyx", line 1, in init pandas._libs.tslib
ImportError: No module named 'pandas._libs.tslibs.timedeltas'

During handling of the above exception, another exception occurred:

...
ImportError: C extension: No module named 'pandas._libs.tslibs.timedeltas' not b
uilt. If you want to import pandas from the source directory, you may need to ru
n 'python setup.py build_ext --inplace --force' to build the C extensions first.

[My attempt]
pyinstaller --onefile --hidden-import pandas._libs.tslibs myapp.py
pyinstaller --onefile --hidden-import pandas._libs.tslibs.timedeltas myapp.py
pandas: C extension pandas.lib not included #1580

@su79eu7k

This comment has been minimized.

su79eu7k commented Nov 14, 2017

Sorry didn't know there is similar topic for this.

Pandas missing pandas._libs.tslibs.timedeltas.so #2978

@iliketrainz98

This comment has been minimized.

iliketrainz98 commented Jun 12, 2018

Hi Guys,
Forgive me if I am wrong, but I think there may be additional items needed to be added to the 'hook-pandas.py'. Such as shown at This Link.
For my code to work, I had to edit my 'hook-pandas.py' to the following:

hiddenimports = ['pandas._libs.tslibs.timedeltas', 'pandas._libs.tslibs.np_datetime', 'pandas._libs.tslibs.nattype', 'pandas._libs.skiplist']

Do these needed to be added in another pull request?
Thanks so much
(P.S. Although I have used GitHub for ages, this is my first time commenting so if I have made any mistakes on what I have done I apologise. Let me know and I won't do it again aha).

@eskemojoe007

This comment has been minimized.

eskemojoe007 commented Jun 27, 2018

Like @iliketrainz98, I needed to add all of those packages to my hidden imports after upgrading my python and pandas packages. I did it locally in my spec file instead of the core hooks-pandas.py

Pandas 0.23.1
Python 3.6.5-32
pyinstaller 3.3.1

@k90mirzaei

This comment has been minimized.

k90mirzaei commented Dec 6, 2018

just run: conda install pandas

@RohitKankhedia

This comment has been minimized.

RohitKankhedia commented Dec 10, 2018

I am still facing issue with same error mentioned in above case. Please help

@htgoebel

This comment has been minimized.

Member

htgoebel commented Dec 10, 2018

@iliketrainz98 If the updated hook does not work four you, please provide a pull-request. Otehrwise this will get lost. Thanks.

@sirasao2

This comment has been minimized.

sirasao2 commented Dec 10, 2018

My code was fine Friday. Monday I have this issues

Traceback (most recent call last):
File "C:\Users\USER\AppData\Roaming\Python\Python37\site-packages\pandas_init_.py", line 26, in
from pandas._libs import (hashtable as hashtable,
File "C:\Users\USER\AppData\Roaming\Python\Python37\site-packages\pandas_libs_init
.py", line 4, in
from .tslib import iNaT, NaT, Timestamp, Timedelta, OutOfBoundsDatetime
File "pandas_libs\tslibs\conversion.pxd", line 11, in init pandas._libs.tslib
ModuleNotFoundError: No module named 'pandas._libs.tslibs.conversion'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "randomForest.py", line 5, in
import pandas as pd
File "C:\Users\USER\AppData\Roaming\Python\Python37\site-packages\pandas_init_.py", line 35, in
"the C extensions first.".format(module))
ImportError: C extension: No module named 'pandas._libs.tslibs.conversion' 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.

@su79eu7k

This comment has been minimized.

su79eu7k commented Dec 11, 2018

Did you guys checked you're already using virtual environment like conda to avoid library interference?

And did you also checked build error message and added it to the hiddenimports = [...] in hook-pandas.py? I mean @sirasao2 in your case, pandas._libs.tslibs.conversion should be manually added to it.

This is quite old but please check this(017b247) commit which was clearly solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment