Using gspread with proxy

可紊 提交于 2021-01-27 04:20:09

问题


I am trying to access google spreadsheets through gspread api in python. I have imported gspread. I am getting socket. error: [Errno 10061] No connection could be made because the target machine actively refused it at gc = gspread.login('pan*******@gmail.com', '********')

Here is my code:

import urllib2
import urllib
import gspread
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont

w = 420

gc = gspread.login('pan******@gmail.com', '*******')
wks = gc.open("Spreadsheet").sheet1

I have checked that the username and password is correct. I have added two environment variables as 'http_proxy':'host:port' and 'https_proxy':'host:port' What am I doing wrong? Thank you.


回答1:


For anyone who might have this problem, I found out that gspread library doesn't support proxy connections. I ran it through normal connection and it worked.



来源:https://stackoverflow.com/questions/29549701/using-gspread-with-proxy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!