无法在 python (Anaconda) 中安装 wordcloud

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41409570/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 00:54:29  来源:igfitidea点击:

Can't install wordcloud in python (Anaconda)

pythonpipanacondaword-cloud

提问by user3503711

I am trying to install wordcloud in my python program. I am doing the following steps. Please tell me where i am doing wrong-

我正在尝试在我的 python 程序中安装 wordcloud。我正在执行以下步骤。请告诉我哪里做错了-

  1. I downloaded the wordcloud package from here https://github.com/amueller/word_cloud

  2. Copy and paste it in the Anaconda3 folder.

  3. Open Anaconda command prompt and give the following command "pip install wordcloud".

  1. 我从这里下载了 wordcloud 包https://github.com/amueller/word_cloud

  2. 将其复制并粘贴到 Anaconda3 文件夹中。

  3. 打开 Anaconda 命令提示符并给出以下命令“pip install wordcloud”。

The following error is showing -

显示以下错误 -

enter image description here

在此处输入图片说明

Please let me know what to do.

请让我知道该怎么做。

回答by Rajan Kumar

You can simply use conda package manager to install wordcloud, just run:

您可以简单地使用 conda 包管理器来安装 wordcloud,只需运行:

conda install -c https://conda.anaconda.org/conda-forge wordcloud

回答by pavitra

There is a new version available now but this one worked for me

现在有一个新版本可用,但这个版本对我有用

enter image description here

在此处输入图片说明

With Anaconda python 3.6

使用 Anaconda python 3.6

  • download from this link.
  • wordcloud 1.3.2?cp36?cp36m?win_amd64.whl
  • Then don't extract the file, copy and paste the dir in cmd.
  • Use this command pip install wordcloud-1.3.2-cp36-cp36m-win_amd64.whl
  • 从此链接下载。
  • wordcloud 1.3.2?cp36?cp36m?win_amd64.whl
  • 然后不要解压文件,将目录复制粘贴到cmd中。
  • 使用这个命令 pip install wordcloud-1.3.2-cp36-cp36m-win_amd64.whl

回答by Brian O'Donnell

It is trying to build Word Cloud using Visual Studio. If you don't have it you can get a subset called "Microsoft Build Tools 2015" here: https://www.microsoft.com/en-us/download/details.aspx?id=48159

它正在尝试使用 Visual Studio 构建 Word Cloud。如果您没有它,您可以在此处获得一个名为“Microsoft Build Tools 2015”的子集:https: //www.microsoft.com/en-us/download/details.aspx?id=48159

Even having a full version of Visual Studio 2015 and my path set up properly I still had trouble installing using pip. I also had no luck with the conda installer. The following worked for me:

即使拥有完整版的 Visual Studio 2015 并且我的路径设置正确,我仍然无法使用 pip 进行安装。我也没有使用 conda 安装程序。以下对我有用:

  1. Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloudand download the wheel for the version of Word Cloud you need.
  2. From the command prompt install using pip. For example, pip install wordcloud-1.2.1-cp27-cp27m-win_amd64.whl
  1. 转到http://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud并下载您需要的 Word Cloud 版本的轮子。
  2. 从命令提示符使用 pip 安装。例如 pip install wordcloud-1.2.1-cp27-cp27m-win_amd64.whl

回答by Shrish Trivedi

Using Anaconda Python 3.6 version For Windows you can do it as:

使用 Anaconda Python 3.6 版本对于 Windows,您可以这样做:

  • Installation of wordcloud package
  • download wordcloud?1.3.2?cp36?cp36m?win_amd64.whl from
    http://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud
  • Copy the file to your current working directory
  • Open command prompt
  • python -m pip install wordcloud-1.3.2-cp36-cp36m-win_amd64.whl

回答by shruti salian

I have python 3.6.3 installed on my windows system. I installed wordcloud package in python but faced the "wordcloud No Module Found" error on Anaconda Jupyter Notebook.

我的 Windows 系统上安装了 python 3.6.3。我在 python 中安装了 wordcloud 包,但在 Anaconda Jupyter Notebook 上遇到了“wordcloud No Module Found”错误。

I tried most of the solutions posted here but nothing worked for me.

我尝试了此处发布的大多数解决方案,但没有任何效果。

Finally I installed wordcloud package in the Scripts directory under Anacond3 directoryin the command prompt using:

最后,我在命令提示符下使用以下命令在 Anacond3 目录下Scripts 目录中安装了 wordcloud 包:

pip install wordcloud

This worked and I am able to import wordcloud on Jupyter now.

这有效,我现在可以在 Jupyter 上导入 wordcloud。

回答by RolandoAmir

I've got the similar error but related to certification, if the error is:

如果错误是:

Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')])",),))',),)

由 SSLError(SSLError("bad handshake: Error([(\'SSLroutines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')])",),))',),)

This other SO question helped me. It basically said to do:

这个其他SO问题帮助了我。它基本上说要做:

conda config --set ssl_verify false

回答by Katharina Aryani

Open JupyterLab from Anaconda dashboard, in terminal 1, run:

从 Anaconda 仪表板打开 JupyterLab,在终端 1 中,运行:

conda install -c conda-forge wordcloud 

Source: link

来源:链接

回答by GaneshKumar C

After a long try:

经过长时间的尝试:

1) Download the latest version of WordCloud from this link.

1) 从此链接下载最新版本的 WordCloud 。

2) Copy it into the Script directory under Anaconda3.

2)复制到Anaconda3下的Script目录下。

3) Open the command prompt and do pip install wordcloud. (If a win[5]authorization error occurs, try doing pipfrom the admin command prompt or sudo pip install wordcloud.)

3)打开命令提示符并执行pip install wordcloud. (如果发生win[5]授权错误,请尝试pip从管理员命令提示符或sudo pip install wordcloud.)

回答by GDB

You should have a virtual environment for each project or group of projects that use a particular set of packages. I use Anaconda. Jupyter should be installed in each of your virtual environments. Let's assume you've already created the environment foo. Then:

您应该为每个项目或使用一组特定包的项目组创建一个虚拟环境。我使用蟒蛇。Jupyter 应该安装在您的每个虚拟环境中。假设您已经创建了环境foo。然后:

  • conda activate foo
  • conda install jupyter
  • conda install -c conda-forge wordcloud
  • conda activate foo
  • conda install jupyter
  • conda install -c conda-forge wordcloud

Now when you do the import it should work. My import:

现在,当您进行导入时,它应该可以工作。我的进口:

from wordcloud import WordCloud, STOPWORDS

from wordcloud import WordCloud, STOPWORDS

I'm working through How to Generate a Word Cloud of Any Shape in Python

我正在研究如何在 Python 中生成任何形状的词云