简体   繁体   English

使用 pip 安装 TextBlob 时出现问题

[英]Trouble installing TextBlob with pip

I'm having a bit of difficulty when installing TextBlob in the command line on Windows 10 using pip.使用 pip 在 Windows 10 的命令行中安装 TextBlob 时,我遇到了一些困难。

According to their docs, you need to run two commands in succession:根据他们的文档,您需要连续运行两个命令:

pip install -U textblob
python -m textblob.download_corpora

Upon trying the first command, I get an error I have never seen before when trying to install a package:在尝试第一个命令时,我在尝试安装 package 时遇到了一个从未见过的错误:

C:\Users\phys>pip install -U textblob
Traceback (most recent call last):
  File "c:\program files (x86)\python37-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files (x86)\python37-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files (x86)\Python37-32\Scripts\pip.exe\__main__.py", line 9, in <module>
TypeError: 'module' object is not callable

I'm not exactly a Windows 10 whiz and I don't really know what's going on here - Could someone please point me in the right direction?我不完全是 Windows 10 高手,我真的不知道这里发生了什么 - 有人可以指出我正确的方向吗?

Thanks!谢谢!

This is an error with the newest version of pip.这是最新版本的 pip 的错误。 If you have recently updated pip and are having this issue, here is what worked for me (based on https://github.com/pypa/pip/issues/7209 ):如果您最近更新了 pip 并且遇到了这个问题,那么这对我有用(基于https://github.com/pypa/pip/issues/7209 ):

python -m pip uninstall pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py --user
python -m pip install --user textblob

This uninstalls and reinstalls pip using --user.这将使用 --user 卸载并重新安装 pip。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM