Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
260 views
in Technique[技术] by (71.8m points)

python - Trouble installing TextBlob with pip

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

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!

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...