4

I am working on a Windows machine with Python3 and IPython notebook in the Anaconda suite. I ran a

pip install charts

to install the package (I am trying to find my way through some flexible and interactive charting...Any suggestion appreciated).

Installation seems to go well, but a import charts command generates an error:

ImportError                               Traceback (most recent call last)
<ipython-input-1-5eb3a6e89685> in <module>()
----> 1 import charts

C:\Users\my_username\AppData\Local\Continuum\Anaconda3\lib\site-packages\charts\__init__.py in <module>()
      3 __version__ = '0.4.3'
      4 
----> 5 from plot import plot, plotasync, line, area, spline, pie
      6 from server import run_server
      7 

      ImportError: No module named 'plot'

If I look into the charts directory - however - I can see a module called 'plot', along with other modules

I found this question which is somewhat related, it looks like something like path issues. But I'm pretty much stuck.

Thanks for helping, Michele

Community
  • 1
  • 1
Michele Ancis
  • 1,265
  • 4
  • 16
  • 29

1 Answers1

1

Write the directory you mentioned containing the plot etc. into pythonpath.

Then try again. More about the use of pythonpath you can read here.

Community
  • 1
  • 1
Geeocode
  • 5,705
  • 3
  • 20
  • 34
  • Thanks. I do not know where this `pythonpath` variable(?) is to be found, can you point me? – Michele Ancis Jul 22 '15 at 10:52
  • You can set it in spyder, in spyder 2.37 there is a quick button in the headline named "Python Path Manager", but in my version it is represented as an icon with no text under. – Geeocode Jul 22 '15 at 10:57
  • Nevermind...I found a way and added PYTHONPATH as variable in my User space under Windows. Now it looks like it imports it...but apparently chart is designed with Python2 in mind...it gave me a 'print' error... `import charts File "C:\Users\my_username\AppData\Local\Continuum\Anaconda3\Lib\site-packages\charts\core.py", line 24 print 'Opening new tab...' ^ SyntaxError: Missing parentheses in call to 'print' ` – Michele Ancis Jul 22 '15 at 11:16
  • 1
    Do you know of any interactive plot package working for Python3? I have come across Plotly but they focus on 'sharing' and I am not allowed to do it :( Is Bokeh a valid alternative? – Michele Ancis Jul 22 '15 at 11:20
  • Well, I only used pyplot so far and under python 2.x – Geeocode Jul 22 '15 at 11:33
  • 1
    matplotlib (which pyplot is part of) works with Python 3. mpld3 builds on top of that to produce plots with d3, which might give you something more like highcharts. Bokeh is another option that will work. There are a lot of plotting packages out there at the moment (see also seaborn, vincent, ggplot), and most of them support Python 3. – Thomas K Jul 22 '15 at 17:11
  • Thanks @ThomasK actually I am quite confused by the sheer amount of possibilities. – Michele Ancis Jul 22 '15 at 21:02
  • Yeah, there's been an explosion of choice for plotting in Python recently. Matplotlib is the oldest: I'd start with that, and re-evaluate the others when you have a more specific feeling for what more you need. – Thomas K Jul 22 '15 at 21:14
  • At the beginning I considered developing some user interface using PyQt, but then I did not know how to link a `matplotlib` graph element to it, so I kept searching. If you know about it, please point me in the right direction. I found that the word "interactive" referred to charts relates to the possibility to zoom, report the data point:I meant possiblity to select parts of the dataset. I started to look into the `interactive` widgets IPython offers and somehow settled for a few sliders and drop-down lists. – Michele Ancis Jul 22 '15 at 21:15