Search code examples
python-3.xvisualizationpython-ggplot

Not able to import ggplot in python 3.5


I have Ubuntu Gnome 16.04 both python 2.7 and python 3.5 installed. I have installed ggplot in python 3.5 but not able to import it.

I am getting ImportError: No module named 'StringIO'.

Am I missing something? As far as I know StringIO module has been merged in io module in python 3.5.


Solution

  • Found the issue, some files have not been fully converted for python3.

    Open file /usr/local/lib/python3.5/dist-packages/ggplot/ggplot.py and change

    import StringIO

    to this

    from io import StringIO

    I am not getting any error now but there could be some other files where python2 codes needs to be converted to work in python3.