1
I’m using the Microsoft Azure
with Jupyter notebook
and I need to use the word cloud.
However when executing the code: from wordcloud import WordCloud
it presents the error
No module named 'wordcloud'
1
I’m using the Microsoft Azure
with Jupyter notebook
and I need to use the word cloud.
However when executing the code: from wordcloud import WordCloud
it presents the error
No module named 'wordcloud'
1
First, on the root page of your project, where your Python script is Terminal right-hand.
Then type ls
. As in the image below, some versions may appear Anaconda. Choose the one you are using and in the same place you typed ls
typhoon source anaconda3_501/bin/activate
.
Done that, in front of your user, in my case nbuser, will appear (groundwork).
Now do the command: pip install wordcloud
. Dependencies will be installed.
After you’re done, with the terminal screen open, open another browser tab with your Python script, and click Kernel > Change Kernel...
.
On the screen that opens choose the terminal you are in session:
Run the script again and see if it works.
It wasn’t.. Note: I think it might be because you’re using Jupyterlab and I’m using Microsoft Azure. I don’t know if that’s why.. but follow the error.............................. Collecting wordcloud
 Downloading https://files.pythonhosted.org/packages/5e/b7/c16286efa3d442d6983b3842f982502c00306c1a4c719c41fb00d6017c77/wordcloud-1.5.0-cp35-cp35m-manylinux1_x86_64.whl (357kB)
 100% |████████████████████████████████| 358kB 320kB/s
Collecting pillow (from wordcloud)
 Downloading https://files.pythonhosted.org/packages/8b/e9/5c47710fe383f0582da668302a80a6355fe15c2ce2dde89b50fe34acefa6/Pillow-5.4.1-cp35-cp35m-manylinux1_x86_64.whl (2.0MB)
 100% |████████████████████████████████| 2.0MB 62kB/s
Collecting numpy>=1.6.1 (from wordcloud) Cache entry deserialization failed, entry Ignored Downloading https://files.pythonhosted.org/packages/ad/15/690c13ae714e156491392cdbdbf41b485d23c285aa698239a67f7cfc9e0a/numpy-1.16.1-cp35m-manylinux1_x86_64.whl (17.2MB)
 100% |████████████████████████████████| 17.2MB 5.8kB/s
Installing collected Packages: Pillow, numpy, wordcloud Exception: Traceback (Most recent call last): File "/usr/local/lib/python3.5/dist-Packages/Pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/lib/python3.5/dist-Packages/Pip/Commands/install.py", line 342, in run prefix=options.prefix_path, File "/usr/local/lib/python3.5/dist-Packages/Pip/req/req_py.", line 784, install **kwargs
File "/usr/local/lib/python3.5/dist-Packages/Pip/req/req_install.py", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/usr/local/lib/python3.5/dist-Packages/Pip/req/req_install.py", line 1064, inmove_wheel_
 files; isolated=self.isolated,
 File "/usr/local/lib/python3.5/dist-packages/pip/wheel.py", line 345, in move_wheel_files
 clobber(source, lib_dir, True)
 File "/usr/local/lib/python3.5/dist-packages/pip/wheel.py", line 316, in clobber
 ensure_dir(destdir)
File "/usr/local/lib/python3.5/dist-Packages/Pip/utils/init.py", line 83, in ensure_dir os.makedirs(path) File "/usr/lib/python3.5/os.py", line 241, in makedirs mkdir(name, mode) Permissionerror: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-Packages/PIL' You are using Pip version 9.0.1, However version 19.0.2 is available. You should consider upgrading via the 'Pip install --upgrade Pip' command.
What exactly are you using? Python Version, Software...
0
Try
python -m pip install wordcloud
you’ll probably need to numpy
and pillow
too
If another problem does not work it may be that you have more than 1 python installed, what to do is
caminho/para/python -m pip install wordcloud
You can try too
!conda install wordcloud -y
I did it, but the error remains.
Any other suggestions? Note: Thank you for trying to help me :)
Did it at the IDE terminal or OS terminal?
At the IDE terminal
I really don’t know, all the problems of modules not found are pq not installed, the last solution I have up my sleeve is to create a new Nvironment, see this example in Conda: Conda create --name [name] wordcloud
What is this? x "Nvironment " ?
I don’t know the IDE you are using but it must be something similar
Environment is where you write the code, simply create a new file only I forced wordcloud right at creation
Browser other questions tagged python python-3.x module ipython-notebook wordcloud
You are not signed in. Login or sign up in order to post.
At the root of the project by the terminal you run the commands that the user below posted as response.
pip install wordcloud
. Try running as an administrator.– Diego Souza
It didn’t work either :/
– Beatriz Benz
You checked if the libs
pillow
andnumpy
are installed? They are dependencies.– Diego Souza
I actually installed them
– Beatriz Benz
error while installing Pillow.. Installing collected Packages: Pillow Exception: Traceback (Most recent call last): File "/usr/local/lib/python3.5/dist-Packages/Pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/lib/python3.5/dist-Packages/Pip/Commands/install.py", line 342, in run prefix=options.prefix_path, File "/usr/local/lib/python3.5/dist-Packages/Pip/req/req_py.", line 784, install in **kwargs ........... CONTINUES
– Beatriz Benz
File "/usr/local/lib/python3.5/dist-Packages/Pip/req/req_install.py", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/usr/local/lib/python3.5/dist-Packages/Pip/req/req_install.py", line 1064, inmove_wheel_
 files; isolated=self.isolated,
 File "/usr/local/lib/python3.5/dist-packages/pip/wheel.py", line 345, in move_wheel_files
 clobber(source, lib_dir, True)
 File "/usr/local/lib/python3.5/dist-packages/pip/wheel.py", line 316, in clobber
 ensure_dir(destdir) ........................ CONTINUES
– Beatriz Benz
File "/usr/local/lib/python3.5/dist-Packages/Pip/utils/init.py", line 83, in ensure_dir os.makedirs(path) File "/usr/lib/python3.5/os.py", line 241, in makedirs mkdir(name, mode) Permissionerror: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-Packages/PIL'
– Beatriz Benz
So, it looks like permission error. Try running sudo or if you are using windows, open CMD with admin permission.
– Diego Souza
I managed to play here, I will post the answer.
– Diego Souza