0
votes

I'm trying to use the Python YouTube Data API Python script that allows to upload a video: https://developers.google.com/youtube/v3/guides/uploading_a_video#Sample_Code. Note that it's compatible Python 2.x, not 3.X. So I've updated its code by replacing the first import ( import httplib ) by this import: import http.client .

When I run this script, the following error is shown:

Traceback (most recent call last): File "/home/xzerzxez/pycharm_projects/zerde/upload_video.py", line 3, in import http.client ImportError: No module named http.client

Process finished with exit code 0

  • PyCharm's used environment: my Ubuntu's one
  • Python version: /usr/bin/python3.6
  • Pertinent packages installed: httplib2, request, requests
  • Available packages to install: micropython-http.client, pycopy-http.client, yieldfrom.http.client

How to solve this problem?

Edit: of course I also made other littles changes to the code to make it compatible Python 3.X, but it's off-topic :-) .

1
what stops you from using python2 your script is written for? - lenik
Because I use this script from anothrr, python 3.6, script - JarsOfJam-Scheduler

1 Answers

0
votes

Solved by changing the shebang to #!/usr/bin/python3