question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi, when I try to run this classic api example:

import plotly.plotly as py
from plotly.graph_objs import *

py.sign_in("myusername", "mykey")

data = Data([
    Bar(
        x=['giraffes', 'orangutans', 'monkeys'],
        y=[20, 14, 23]
    )
])

plot_url = py.plot(data, filename='basic-bar')

I get this error:

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    import plotly.plotly as py
  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 on linux mint 16 - Python 2.7.5+ Any clues ?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
NamrataaKkomminenicommented, Mar 22, 2017

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 “<stdin>”, line 1, in <module> ImportError: No module named plotly

thanks for help.

1reaction
cyber42commented, Aug 16, 2014

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 notifications@github.com:

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 https://github.com/plotly/python-api/issues/104#issuecomment-52404670.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >
Python Exception Handling: ImportError and ... - Airbrake Blog
The ImportError is raised when an import statement has trouble successfully importing the specified module. Typically, such a problem is due to ...
Read more >
Python Import Error (ModuleNotFoundError) - Finxter
Python's ImportError ( ModuleNotFoundError ) indicates that you tried to import a module that Python doesn't find. It can usually be eliminated by...
Read more >
import error: 'No module named' *does* exist - python
I set the PYTHONPATH to '.' and that solved it for me. export PYTHONPATH='.' For a one-liner you could as easily do: PYTHONPATH='....
Read more >
How to catch ImportError Exception in Python? - Tutorialspoint
ImportError is raised when a module, or member of a module, cannot be imported. There are a two conditions where an ImportError might...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found