Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

302
Views
Python in Google Cloud Functions

Can Google Cloud Functions handle python with packages like sklearn, pandas, etc? If so, can someone point me in the direction of resources on how to do so.

I've been searching a while and it seems like this is impossible, all I've found are resources to deploy the base python language to google cloud.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Python 3.7 is supported now.
Steps to create one via the google cloud console:

  1. go to google cloud functions in the google cloud console and click on create function enter image description here

2.specify the function's properties enter image description here

  1. select trigger enter image description here

4.change runtime to python 3.7 enter image description here

  1. enter your cloud function logic and entry point enter image description here

  2. enter python dependencies in requirements.txt enter image description here

over 4 years ago · Santiago Trujillo Report

0

EDIT: As of July 2018 there is now a Python runtime (3.7) available for Google Cloud Functions!

OLD ANSWER: Google Cloud Functions (GCF) are written in JavaScript (executed in a Node.js runtime), so there is no way for them to actually handle Python at this moment. There is a Python module at GitHub that you might have come across and it can be used to write and deploy GCF with one of three trigger types: http, Pub/Sub and bucket. The module takes care of translating your Python logic to a JavaScript code that is later run inside Google Cloud Platform.

When it comes to other packages like pandas, the ‘translation’ into JavaScript was not prepared for them by anyone AFAIK. If you really don’t like the idea of jumping into JavaScript and writing the Cloud Function code on your own (with the logic you intended to use in a Python script), you have a possible workaround. You can evoke your Python script from inside of the Cloud Function written in JS - the idea was discussed in this topic. Another way is using Object Change Notifications or Pub/Sub Notifications as explained here.

over 4 years ago · Santiago Trujillo Report

0

As of 19th July 2018, Google Cloud Functions supports Python 3.7.

Kindly check the Runtime environment to find the Python 3.7 runtime and sample script (based on Flask) .

--UPDATED--

Official Documentation for the Google Cloud Functions - Python 3.7 support Beta Release.

This is a beta release of the Python runtime for Google Cloud Functions. This feature might be changed in backward-incompatible ways and is not subject to any SLA or deprecation policy.

SkLearn, Numpy is supported in Google Cloud function. Also I've run a sample test to confirm the availability of Pandas as well and its working fine.

https://github.com/mkanchwala/google-functions-python-example

Hope this helps to all the "Py" lovers.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!