问题
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