我正在尝试打开一个网站/链接,提取其中的Excel文件,进行编辑,然后将其放在另一个网站上。我在该网站上找到了另一条评论,其中有很好的建议可以使用import pandas
来完成此操作。
我从Python网站下载了pandas(和其他一些模块),并编写了代码。但是当我尝试运行它时,我会收到以下错误信息。
Warning (from warnings module):
File "C:\Python27\lib\site-packages\pandas\io\excel.py", line 626
.format(openpyxl_compat.start_ver, openpyxl_compat.stop_ver))
UserWarning: Installed openpyxl is not supported at this time. Use >=1.6.1 and <2.0.0.
Traceback (most recent call last):
File "C:\Python27\more_url_stuff.py", line 6, in <module>
socket = urllib2.urlopen(link)
File "C:\Python27\lib\urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 410, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 448, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 382, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 401: Unauthorized
发生了什么事?
有没有更简单的方法从互联网下载Excel文件?
我上周刚开始使用Python编程,所以对一些简单的事情还感到困惑。
警告:当前安装的openpyxl版本不受支持。请使用>=1.6.1且<2.0.0的版本。
你的openpyxl
版本是多少? - WGS