I tried to run a Python script that uses the download_url_to_file method inside the torch hub, but I got the following error:
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'
I am using Python version 3.6.2. I also have the packages installed with the following versions:
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)
The download_url_to_file method does not appear to be found inside the hub file, but I checked the torch hub, and made sure it was defined! How can this error be fixed?