Trouble installing TextBlob with pip

拥有回忆 提交于 2019-12-27 16:02:14

问题


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:\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?

Thanks!


回答1:


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

This uninstalls and reinstalls pip using --user.



来源:https://stackoverflow.com/questions/58442401/trouble-installing-textblob-with-pip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!