GithubHelp home page GithubHelp logo

import error about plotly.py HOT 11 CLOSED

plotly avatar plotly commented on May 2, 2024
import error

from plotly.py.

Comments (11)

cyber42 avatar cyber42 commented on May 2, 2024 1

That was it! Have misunderstood what "--upgrade" is for, as I thought I
have installed the latest stable version with "pip install plotly" anyway.
Apparently the dependencies where upgraded too.

Thanks, you made my day!

Mรกrk

2014-08-16 22:18 GMT+02:00 Charles-Emmanuel [email protected]:

I'm sorry, I don't recall correctly what i've done to fix it. Have you
done a pip install --upgrade plotly ?

โ€”
Reply to this email directly or view it on GitHub
#104 (comment).

from plotly.py.

NamrataaKkommineni avatar NamrataaKkommineni commented on May 2, 2024 1

Hi i am new to using mac and trying to install plotly on mac using python 2.7.
pip install plotly (worked)
pip install --upgrade plotly (worked)
Still i am getting import error as follows:

import plotly
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named plotly

thanks for help.

from plotly.py.

cedias avatar cedias commented on May 2, 2024

Reinstalled, work...
Never mind ๐Ÿ‘

from plotly.py.

cyber42 avatar cyber42 commented on May 2, 2024

I have the same issue, but reinstalling plotly doesn't help. Did you only reinstall plotly or more pakages?

My stacktrace:

Python 2.7.5+ (default, Feb 27 2014, 19:37:08) 
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import plotly
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/plotly/__init__.py", line 31, in <module>
    from plotly import plotly, graph_objs, tools, utils
  File "/usr/local/lib/python2.7/dist-packages/plotly/plotly/__init__.py", line 12, in <module>
    from plotly.plotly.plotly import *
  File "/usr/local/lib/python2.7/dist-packages/plotly/plotly/plotly.py", line 29, in <module>
    from plotly import tools
  File "/usr/local/lib/python2.7/dist-packages/plotly/tools.py", line 20, in <module>
    from . graph_objs import graph_objs
  File "/usr/local/lib/python2.7/dist-packages/plotly/graph_objs/__init__.py", line 12, in <module>
    from plotly.graph_objs.graph_objs import *
  File "/usr/local/lib/python2.7/dist-packages/plotly/graph_objs/graph_objs.py", line 281, in <module>
    @six.add_metaclass(ListMeta)
AttributeError: 'module' object has no attribute 'add_metaclass'```


I'm also on 2.7.5+ Python but on Ubuntu 13.

from plotly.py.

cedias avatar cedias commented on May 2, 2024

have you properly installed all dependencies ?

The User Guide assumes:
The lastest version of Plotly's Python package (see step 3 )
Python version 2.7.5+ or 2.7.6 with
numpy (version 1.8.1), for all sections
pandas (version 0.13.1), for sections 3, 5 and 7.3
scipy (version 0.13.3), for section 4 and 7
matplotlib (version 1.3.1), for section 6
IPython version 2.0.0

https://plot.ly/python/user-guide/#Step-1

from plotly.py.

cyber42 avatar cyber42 commented on May 2, 2024

Good point, for importing I guess we only need numpy and pandas. Seem to have proper versions there (below). Did you reinstall all of them or only plotly?

Python 2.7.5+ (default, Feb 27 2014, 19:37:08) 
Type "copyright", "credits" or "license" for more information.

IPython 2.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import numpy

In [2]: numpy.__version__
Out[2]: '1.8.1'

In [3]: import pandas

In [4]: pandas.__version__
Out[4]: '0.13.1'

In [5]: import plotly
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-c27a4132ad2e> in <module>()
----> 1 import plotly

/usr/local/lib/python2.7/dist-packages/plotly/__init__.py in <module>()
     29 from __future__ import absolute_import
     30 
---> 31 from plotly import plotly, graph_objs, tools, utils
     32 from plotly.version import __version__

/usr/local/lib/python2.7/dist-packages/plotly/plotly/__init__.py in <module>()
     10 from __future__ import absolute_import
     11 
---> 12 from plotly.plotly.plotly import *
     13 
     14 __all__ = ["sign_in", "update_plot_options", "get_plot_options",

/usr/local/lib/python2.7/dist-packages/plotly/plotly/plotly.py in <module>()
     27 from plotly.plotly import chunked_requests
     28 from plotly import utils
---> 29 from plotly import tools
     30 from plotly import exceptions
     31 from plotly import version

/usr/local/lib/python2.7/dist-packages/plotly/tools.py in <module>()
     18 from plotly import exceptions
     19 
---> 20 from . graph_objs import graph_objs
     21 
     22 # Warning format

/usr/local/lib/python2.7/dist-packages/plotly/graph_objs/__init__.py in <module>()
     10 from __future__ import absolute_import
     11 
---> 12 from plotly.graph_objs.graph_objs import *
     13 
     14 __all__ = ["Data",

/usr/local/lib/python2.7/dist-packages/plotly/graph_objs/graph_objs.py in <module>()
    279         return super(DictMeta, mcs).__new__(mcs, name, bases, attrs)
    280 
--> 281 @six.add_metaclass(ListMeta)
    282 class PlotlyList(list):
    283     """A container for PlotlyDicts, inherits from standard list.

AttributeError: 'module' object has no attribute 'add_metaclass'

from plotly.py.

cedias avatar cedias commented on May 2, 2024

I'm sorry, I don't recall correctly what i've done to fix it. Have you done a pip install --upgrade plotly ?

from plotly.py.

cedias avatar cedias commented on May 2, 2024

No problem, have fun plotting !

from plotly.py.

Tui-yy avatar Tui-yy commented on May 2, 2024

same issue as nees2012

from plotly.py.

Moonmun avatar Moonmun commented on May 2, 2024

facing the same issue., upgrade command does no help

from plotly.py.

codebanesr avatar codebanesr commented on May 2, 2024

upgrade helped me

from plotly.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.