[英]ImportError: cannot import name 'quote' from 'urllib' (/usr/lib/python3.7/urllib/__init__.py)
i am using praat from parselmouth in gooogle colab and i am getting this error when importing from parselmouth.praat import call我在 gooogle colab 中使用来自 parselmouth 的 praat,从 parselmouth.praat 导入调用导入时出现此错误
/usr/local/lib/python3.7/dist-packages/parselmouth/adapters/dfp/interface.py in <module>()
15 from datetime import timedelta
16 from pytz import timezone
---> 17 from urllib import quote
18
19 # Parselmouth Imports
ImportError: cannot import name 'quote' from 'urllib' (/usr/lib/python3.7/urllib/__init__.py)
i tried installing diffirent version of urllib but nothing worked我尝试安装不同版本的 urllib 但没有任何效果
i know that urllib uses import urllib.parse.quote
instead of from urllib import quote
but i am not the one importing the urllib package it s the praat module and i cannot change it我知道 urllib 使用
import urllib.parse.quote
而不是from urllib import quote
但我不是导入 urllib package 的人,它是 praat 模块,我无法更改它
I had the same problem and I fixed it by running pip uninstall parselmouth
, then pip install praat-parselmouth
我有同样的问题,我通过运行
pip uninstall parselmouth
修复它,然后pip install praat-parselmouth
Also see this Github issue另请参阅此Github 问题
If you look at the urllib
documentation , you'll find that the quote()
function is part of the urllib.parse
module.如果您查看
urllib
文档,您会发现quote()
function 是urllib.parse
模块的一部分。 Thus:因此:
from urllib.parse import quote
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.