You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi ,
I am trying to run my code over cloud-function which has a dependency of pandas in it.But after deploying the function and triggering it,facing the following error:
ImportError: C extension: No module named timedeltas 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. Failed to execute script main
I am using
Python version 2.7
Pandas Version 0.22.0
This seems to be an error with C extensions and building them for the cloud function. It might be an easy task, it might not but I don't currently have a solution for you, unfortunately. I would recommend cloning the repository and fiddling about with the source code. Maybe there are some options in pyinstaller you can use? Also, as per the readme, there might be some more modules that must be added explicitly for import.
Thanks, I should be able to get that into an update. I also have some other issues that seems mostly related to hidden imports - it seems that just updating pyinstaller version should fix this issue if the links you are referring to are correct.
Just add '--hidden-import', 'pandas._libs.tslibs.timedeltas', inside cloud-functions-python/cloudfn/cli.pybuild function, then BUILD INSTALL the cloud-function-python
Activity
MartinSahlen commentedon Jan 22, 2018
This seems to be an error with C extensions and building them for the cloud function. It might be an easy task, it might not but I don't currently have a solution for you, unfortunately. I would recommend cloning the repository and fiddling about with the source code. Maybe there are some options in pyinstaller you can use? Also, as per the readme, there might be some more modules that must be added explicitly for import.
SushantVarshney commentedon Jan 23, 2018
@MartinSahlen Can you tell me which file is used to install any dependency on Cloud Function?
SushantVarshney commentedon Jan 23, 2018
@MartinSahlen
Found some links to solve the above mentioned issues,but don't know how to use it inside your code
Can you do the above changes or tell me how to do changes?
MartinSahlen commentedon Jan 23, 2018
Thanks, I should be able to get that into an update. I also have some other issues that seems mostly related to hidden imports - it seems that just updating pyinstaller version should fix this issue if the links you are referring to are correct.
santhoshdc1590 commentedon Mar 29, 2018
@SushantVarshney I think this Hooks: Add hook-pandas.py to fix issue should help you resolve the issue
Just add
'--hidden-import', 'pandas._libs.tslibs.timedeltas',insidecloud-functions-python/cloudfn/cli.pybuildfunction, thenBUILD INSTALLthecloud-function-pythonYou should be able to solve it