编辑这篇文章:我对终端中的命令不正确,他们在powershell中工作,并感谢您对Linux子系统的建议。
问题: 我在安装wordcloud时遇到了麻烦,我并没有真正理解我所看到的错误(如下所示)。 Link to wordcloud github page。我尝试使用wget https://github.com/amueller/word_cloud/archive/master.zip来进行pip install,conda install和下载手动安装(在PowerShell中无法识别unzip命令)。帮助
C:\Users\ghodg>pip install wordcloud
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\pip-script.py", line 3, in <module>
import pip
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\__init__.py", line 26, in <module>
from pip.utils import get_installed_distributions, get_prog
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\utils\__init__.py", line 27, in <module>
from pip._vendor import pkg_resources
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3018, in <module>
@_call_aside
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3004, in _call_aside
f(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3046, in _initialize_master_working_set
dist.activate(replace=False)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2578, in activate
declare_namespace(pkg)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2152, in declare_namespace
_handle_ns(packageName, path_item)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2092, in _handle_ns
_rebuild_mod_path(path, packageName, module)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2121, in _rebuild_mod_path
orig_path.sort(key=position_in_sys_path)
AttributeError: '_NamespacePath' object has no attribute 'sort'
答案 0 :(得分:1)
Windows终端没有任何这些命令。这些是Bash命令(命令语言)。有Git Bash,您可以从这里下载:https://git-for-windows.github.io/它有一些命令缺失,虽然它可以帮助。这也是:https://msdn.microsoft.com/en-us/commandline/wsl/about应该安装
编辑:可能是 pip 的版本。试试pip3 install wordcloud
如果您遇到错误,可以尝试sudo apt install python3-pip
或 (if you are a Windows user) py -m pip3 install wordcloud
或 py3 -m pip install wordcloud
。我不确定哪一个会起作用,因为我是Linux用户,尽管之前我曾经使用过Windows。
答案 1 :(得分:0)
似乎是issue with setuptools。您可能需要升级setuptools并首先使用pip install -U setuptools pip
点击。