对 https://drive.google.com/ 的 wget 请求中的语法错误

Syntax error in wget request to https://drive.google.com/

我在这个请求中遇到语法错误:

wget "https://drive.google.com/uc?id=1Djfm4PqE7Su4WqEdZKiGL-8HtrbVBuMm mv uc?id=1Djfm4PqE7Su4WqEdZKiGL-8HtrbVBuMm HorizonZero.png"

如何消除这个错误?

error:File "C:/Users/user/PycharmProjects/arnoldmap/arnold map.py", line 9, in from google.colab.patches import cv2_imshow ModuleNotFoundError: No module named 'google.colab'

我 google 但我没有得到正确的语法。

from PIL import Image
import numpy as np
import os
from matplotlib.pyplot import imshow
import matplotlib.pyplot as plt
import cv2
import random
from math import log
from google.colab.patches import cv2_imshow   # error on this line

from tqdm import tqdm
import wget
# Downloading HorizonZero.png
wget "https://drive.google.com/uc?id=1Djfm4PqE7Su4WqEdZKiGL-8HtrbVBuMm 
mv uc?id=1Djfm4PqE7Su4WqEdZKiGL-8HtrbVBuMm HorizonZero.png"

# Downloading lena.bmp
wget "https://drive.google.com/uc?id=19xZhsjs_r0tLwtu_Wl5DB5rG26dhw069 
mv uc?id=19xZhsjs_r0tLwtu_Wl5DB5rG26dhw069 lena.bmp"

来自文档:https://pypi.org/project/wget/

在批处理脚本中调用:

python -m wget [options] <URL>

或在 python 脚本中:

filename = wget.download("https://drive.google.com/uc?id=1Djfm4PqE7Su4WqEdZKiGL-8HtrbVBuMm mv uc?id=1Djfm4PqE7Su4WqEdZKiGL-8HtrbVBuMm HorizonZero.png")