Umair Malik
Umair Malik

Reputation: 35

Deploying python file on google cloud

i am trying to deploy my python script on google cloud platform but when i run it on google cloud it keeps on giving me errors like no module found named 'requests' or some other modules as well, so how do i run these module on google cloud.

here are the list of modules that i am using:

from flask import Flask, render_template, request, redirect
from datetime import datetime
from tqdm import tqdm
import ctypes
import requests
import re
import os
import easygui

and here is the error that i am getting on google cloud platform:

ModuleNotFoundError: No module named 'requests'
at <module> (/app/app.py:5)
at _call_with_frames_removed (<frozen importlib._bootstrap>:219)
at exec_module (<frozen importlib._bootstrap_external>:783)
at _load_unlocked (<frozen importlib._bootstrap>:671)
at _find_and_load_unlocked (<frozen importlib._bootstrap>:975)
at _find_and_load (<frozen importlib._bootstrap>:991)
at _gcd_import (<frozen importlib._bootstrap>:1014)
at import_module (/usr/local/lib/python3.8/importlib/__init__.py:127)
at import_app (/usr/local/lib/python3.8/site-packages/gunicorn/util.py:358)
at load_wsgiapp (/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py:39)
at load (/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py:49)
at wsgi (/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py:67)
at load_wsgi (/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py:144)
at init_process (/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py:119)
at init_process (/usr/local/lib/python3.8/site-packages/gunicorn/workers/gthread.py:92)
at spawn_worker (/usr/local/lib/python3.8/site-packages/gunicorn/arbiter.py:583)

Please Help

Upvotes: 0

Views: 263

Answers (1)

Kraay89
Kraay89

Reputation: 947

The same way you get it to work on your PC. You install the python modules that are missing. Check out google cloud's help section on how to do that at installing-python-dependencies.

Upvotes: 1

Related Questions