Python - module not found even if installed

Following my own tutorial (YouTube API - Making Comments (Guide)) but for the first time on Glitch. Here is the project: https://glitch.com/edit/#!/yt-api-comments?path=script.py%3A12%3A0 You can see it is installed via pip (in requirements.txt), but still pops up as not being installed as error in logs. Any reason why this is happening?

Doesn’t show when I do:

python

and then

help("modules")

whereas the google oauth I also installed does
image

You check installed Python modules by running either pip list or pip3 list depending on what version of Python you are using.

Get back:

Package                  Version
------------------------ ----------------------
cachetools               4.1.1
certifi                  2020.6.20
chardet                  3.0.4
google-api-core          1.21.0
google-api-python-client 1.9.3
google-auth              1.18.0
google-auth-httplib2     0.0.3
google-auth-oauthlib     0.4.1
googleapis-common-protos 1.52.0
httplib2                 0.18.1
idna                     2.10
oauthlib                 3.1.0
pip                      20.1.1
protobuf                 3.12.2
pyasn1                   0.4.8
pyasn1-modules           0.2.8
pycurl                   7.43.0
pygobject                3.20.0
python-apt               1.1.0b1+ubuntu0.16.4.8
pytz                     2020.1
requests                 2.24.0
requests-oauthlib        1.3.0
rsa                      4.6
setuptools               47.3.1
six                      1.15.0
unattended-upgrades      0.1
uritemplate              3.0.1
urllib3                  1.25.9
wheel                    0.29.0

That should work https://github.com/googleapis/google-api-python-client/blob/master/docs/start.md

I have also tried

pip install --upgrade google-api-python-client

Changing your start.sh to read as

python3 script.py

solved the module not found errors, though there seems to still be some unrelated syntax issues…

1 Like

Yes, are inputs not supported on Glitch? inputs should work right?

They’ll work if you run it in an interactive terminal with python3 script.py but because Glitch is looking to open a headless web server at your project subdomain it can’t halt for user input at start-up.

1 Like

That works! I’ll just leave it at that!
Thanks so much for the help :slight_smile:
Eddie