来自请求的Python/TravisCi异常urllib.request.urlretrieve文件ImportError:没有名为“”的模块

2024-03-28 16:50:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在运行python脚本抛出Travis CI

我导入:

from urllib.request import urlretrieve

 urlretrieve(download_url, save_local)

当我在本地机器上运行这个脚本时,我没有问题,但是当我调用脚本文件throw时特拉维斯·伊梅尔我得到:

Traceback (most recent call last):
File "./scripts/python/file.py", line 6, in <module>
from urllib.request import urlretrieve
ImportError: No module named request

“我创造”要求.txt“,但它没有按预期工作

我错过了什么?你知道吗


Tags: 文件fromimport脚本travis机器ciurl