0

I m trying to deploy a python cloud function to GCP that uses the package msgpack (I already successfully deployed many cloud functions before so I m pretty much used to the process). So I got my requirements.txt containing msgpack but the deployment fails with the error : ModuleNotFoundError: No module named 'msgpack'.

I tried putting in requirements just msgpack but also msgpack=0.6.0 but it didn't change anything. My python script runs perfectly when ran locally so I know there is no other issue than that.

Thanks in advance for your help.

beQr
  • 503
  • 1
  • 4
  • 8

1 Answers1

0

Ok I found the solution ... I wasn't aware that Cloud Functions were able to use the files Pipfile and Pipfile.lock that are generated by pipenv and that I didn't update. Adding them to .gcloudignore fixed the problem. You can also fix pipenv dependency files with: pipenv install -r requirements.txt

beQr
  • 503
  • 1
  • 4
  • 8