使用 pip 安装 TextBlob 时遇到问题 [英] Trouble installing TextBlob with pip

查看:32
本文介绍了使用 pip 安装 TextBlob 时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 pip 在 Windows 10 的命令行中安装 TextBlob 时遇到了一些困难.

I'm having a bit of difficulty when installing TextBlob in the command line on Windows 10 using pip.

根据他们的文档,你需要连续运行两个命令:

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:

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

我不完全是 Windows 10 高手,我真的不知道这里发生了什么 - 有人能指出我正确的方向吗?

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?

谢谢!

推荐答案

这是 pip 最新版本的错误.如果您最近更新了 pip 并且遇到了这个问题,这对我有用(基于 https://github.com/pypa/pip/issues/7209):

This is an error with the newest version of 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):

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

这将使用 --user 卸载并重新安装 pip.

This uninstalls and reinstalls pip using --user.

这篇关于使用 pip 安装 TextBlob 时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆