0

I am unable to install and use spotify's visualization module which is called chartify. https://github.com/spotify/chartify

In the installation it claims I only need to pip3 install it which I did using cmd. Now I have opened my jupyter notebook, and when I try to import the module it can not find it.

import chartify

I expect the module to be imported but instead i get the following

--------ModuleNotFoundError         Traceback (most recent call last)
<ipython-input-32-e4ea3e2db907> in <module>()
----> 1 import chartify

ModuleNotFoundError: No module named 'chartify'
Marcel
  • 11
  • 3
  • you can easily clone/download the files and use setup to install. – MEdwin Jan 22 '19 at 12:20
  • If I had to make an educated guess the problem might be that your jupyter is not installed into the same python interpreter as chartify. You should be able to fix it by also doing pip3 install jupyter – cel Jan 22 '19 at 12:23
  • can you import chartify from your python console? – MEdwin Jan 22 '19 at 12:25
  • @MEdwin I have now downloaded and ran setup.py which quickly opens and closes. I tried running it in the same folder where my notebook is and I still get the same error when I try importing. Moreover, I tried restarting kernal, but nothing has changed. – Marcel Jan 22 '19 at 12:27
  • @cel I have just tried running cmd with pip3 install jupyter I get that all have already been sucecssfully isntalled. – Marcel Jan 22 '19 at 12:30
  • make sure you open up a cmd console, then go the path python was installed then run: "python.exe setup.py". Let me know what happens or which error message you get. – MEdwin Jan 22 '19 at 12:30
  • you actually need to try: "pip3 install chartify" – MEdwin Jan 22 '19 at 12:33
  • @MEdwin I have previously installed it as pip3 and everything was sucessful. Now when I try to run the code I get the following (null): can't open file 'setup.py': [Errno 2] No such file or directory – Marcel Jan 22 '19 at 12:51
  • you will need to be in the same folder as the folder you downloaded the files with 'setup.py'. So go to cmd and keep moving (change directory) till you go the folder where you have 'setup.py'. then run the code. – MEdwin Jan 22 '19 at 13:12

3 Answers3

1

Open a notebook, and enter

import sys
!{sys.executable} -m pip install chartify

into a code cell, execute it, and see how it goes.

It might not work due to missing permissions, but that is fixable.

jhermann
  • 2,071
  • 13
  • 17
0

we get ModuleNotFoundError: No module named 'chartify' error when the library is not installed .... so i request you to run

pip install chartify

or

conda install chartify

... and then try to import it...... I guess you dont have it installed or downloaded it yet

Puneet Sinha
  • 1,041
  • 1
  • 10
  • 23
  • When I try to pip install it, it says all the requirements are already satisfied; But when I try to install it with conda I get 'conda' is not recognized as an internal or external command, operable program or batch file. Which I dont understand as I have anaconda installed and I am running jupyter notebook normally otherwise. – Marcel Jan 22 '19 at 12:48
0

Although the question is old, just for the sake of anyone else who may be reading this: The recommended way of using pip is

python -m pip install <packagename>

Also if you are on Linux (which I'm guessing coz you are typing pip3 and not specified the os) it is recommended that you create a virtual environment to avoid having packages installed for your system python installation.

The reason you do this, on Linux specially is if you have programs which run on python will install a specific version of python for your system. In cases like this where either the package on version of python changes which causes incompatibility between packages, python or the installed program will become a mess to fix.

Always make a virtual enviornment with:

python -m venv <ENV_NAME>
cd <ENV_NAME>
.\bin\activate
python -m pip install <packagename>

When you are done working on the project just do:

deactivate
Canute S
  • 334
  • 1
  • 5
  • 12