ImportError: cannot import name 'quote' from 'urllib' (/usr/lib/python3.7/urllib/__init__.py)
ImportError: cannot import name 'quote' from 'urllib' (/usr/lib/python3.7/urllib/__init__.py)
我在 gooogle colab 中使用来自 parselmouth 的 praat,我在导入 from parselmouth.praat import call
时遇到此错误
/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)
我尝试安装不同版本的 urllib 但没有任何效果
我知道 urllib 使用 import urllib.parse.quote
而不是 from urllib import quote
但我不是导入 urllib 包的人,它是 praat 模块,我无法更改它
如果您查看 urllib
documentation,您会发现 quote()
函数是 urllib.parse
模块的一部分。因此:
from urllib.parse import quote
我遇到了同样的问题,我通过 运行 pip uninstall parselmouth
解决了它,然后 pip install praat-parselmouth
一些信息here
另见此Github issue
我在 gooogle colab 中使用来自 parselmouth 的 praat,我在导入 from parselmouth.praat import call
时遇到此错误/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)
我尝试安装不同版本的 urllib 但没有任何效果
我知道 urllib 使用 import urllib.parse.quote
而不是 from urllib import quote
但我不是导入 urllib 包的人,它是 praat 模块,我无法更改它
如果您查看 urllib
documentation,您会发现 quote()
函数是 urllib.parse
模块的一部分。因此:
from urllib.parse import quote
我遇到了同样的问题,我通过 运行 pip uninstall parselmouth
解决了它,然后 pip install praat-parselmouth
一些信息here
另见此Github issue