ImportError: cannot import name 'download_url_to_file'

ImportError: cannot import name 'download_url_to_file'

我尝试运行一个Python脚本,里面使用了download_url_to_file方法torch hub,但出现以下错误:

Traceback (most recent call last):
  File "crop-video.py", line 1, in <module>
    import face_alignment
  File "$PROGRAMS_PATH$\Python\Python36\lib\site-packages\face_alignment-1.3.3-py3.6.egg\face_alignment\__init__.py", line 7, in <module>
  File "$PROGRAMS_PATH$\Python\Python36\lib\site-packages\face_alignment-1.3.3-py3.6.egg\face_alignment\api.py", line 7, in <module>
  File "$PROGRAMS_PATH$\Python\Python36\lib\site-packages\face_alignment-1.3.3-py3.6.egg\face_alignment\utils.py", line 13, in <module>
ImportError: cannot import name 'download_url_to_file'

我正在使用 Python 版本 3.6.2。我还安装了以下版本的软件包:

certifi (2020.12.5)
chardet (4.0.0)
cycler (0.10.0)
dataclasses (0.8)
decorator (4.4.2)
face-alignment (1.3.3)
future (0.18.2)
idna (2.10)
imageio (2.9.0)
imageio-ffmpeg (0.4.3)
kiwisolver (1.3.1)
llvmlite (0.36.0)
matplotlib (3.3.4)
networkx (2.5)
numba (0.53.0)
numpy (1.19.5)
opencv-python (4.5.1.48)
Pillow (8.1.2)
pip (9.0.1)
pyparsing (2.4.7)
python-dateutil (2.8.1)
PyWavelets (1.1.1)
requests (2.25.1)
rocketchat-API (0.6.9)
scikit-image (0.17.2)
scipy (1.5.4)
setuptools (28.8.0)
six (1.15.0)
tifffile (2020.9.3)
torch (1.0.0)
torchvision (0.2.1)
tqdm (4.24.0)
typing-extensions (3.7.4.3)
unknown (0.0.0)
urllib3 (1.26.4)

download_url_to_file方法似乎在集线器文件中找不到,但我检查了torch hub,并确保它已被定义!如何修复此错误?

在我的电脑上工作
使用 torch == 1.6