# Cannot import plotly can anyone help me understand that?

**URL:** <https://community.plotly.com/t/cannot-import-plotly-can-anyone-help-me-understand-that/2771>\
**Category:** 📊 Plotly Python\
**Created:** [November 24, 2016, 9:12pm UTC](https://community.plotly.com/t/cannot-import-plotly-can-anyone-help-me-understand-that/2771 "2016-11-24T21:12:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DOMDOM](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@DOMDOM](https://community.plotly.com/u/DOMDOM)\
**Post date:** [November 24, 2016, 9:12pm UTC](https://community.plotly.com/t/cannot-import-plotly-can-anyone-help-me-understand-that/2771/1 "2016-11-24T21:12:31Z")

</div>

Hi there forlks, just installed plotly python on Ubuntu 15.10

i’ve installed numpy and of course installed plotly via pip  
my current plotly version is 1.12.9 , if I print on screen pip show plotly. The problem is that when I try to import plotly via python i gets this error:

python

> > import plotly  
> > Traceback (most recent call last):  
> > File “”, line 1, in   
> > File “/usr/local/lib/python2.7/dist-packages/plotly/ **init**.py”, line 31, in   
> > from plotly import (plotly, graph\_objs, grid\_objs, tools, utils, session,  
> > File “/usr/local/lib/python2.7/dist-packages/plotly/plotly/ **init**.py”, line 10, in   
> > from . plotly import (  
> > File “/usr/local/lib/python2.7/dist-packages/plotly/plotly/plotly.py”, line 31, in   
> > from plotly import exceptions, tools, utils, version, files  
> > File “/usr/local/lib/python2.7/dist-packages/plotly/tools.py”, line 21, in   
> > from plotly import graph\_reference  
> > File “/usr/local/lib/python2.7/dist-packages/plotly/graph\_reference.py”, line 518, in   
> > GRAPH\_REFERENCE = get\_graph\_reference()  
> > File “/usr/local/lib/python2.7/dist-packages/plotly/graph\_reference.py”, line 93, in get\_graph\_reference  
> > timeout=GRAPH\_REFERENCE\_DOWNLOAD\_TIMEOUT)  
> > File “/home/domenico/.local/lib/python2.7/site-packages/requests/api.py”, line 70, in get  
> > return request(‘get’, url, params=params, \*\*kwargs)  
> > File “/home/domenico/.local/lib/python2.7/site-packages/requests/api.py”, line 56, in request  
> > return session.request(method=method, url=url, \*\*kwargs)  
> > File “/home/domenico/.local/lib/python2.7/site-packages/requests/sessions.py”, line 488, in request  
> > resp = self.send(prep, \*\*send\_kwargs)  
> > File “/home/domenico/.local/lib/python2.7/site-packages/requests/sessions.py”, line 609, in send  
> > r = adapter.send(request, \*\*kwargs)  
> > File “/home/domenico/.local/lib/python2.7/site-packages/requests/adapters.py”, line 423, in send  
> > timeout=timeout  
> > File “/home/domenico/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py”, line 594, in urlopen  
> > chunked=chunked)  
> > File “/home/domenico/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py”, line 350, in \_make\_request  
> > self.\_validate\_conn(conn)  
> > File “/home/domenico/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py”, line 835, in \_validate\_conn  
> > conn.connect()  
> > File “/home/domenico/.local/lib/python2.7/site-packages/requests/packages/urllib3/connection.py”, line 330, in connect  
> > cert = self.sock.getpeercert()  
> > File “/home/domenico/.local/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py”, line 324, in getpeercert  
> > ‘subjectAltName’: get\_subj\_alt\_name(x509)  
> > File “/home/domenico/.local/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py”, line 171, in get\_subj\_alt\_name  
> > ext = cert.extensions.get\_extension\_for\_class(  
> > **AttributeError: ‘Extensions’ object has no attribute ‘get\_extension\_for\_class’**

Someone has any idea what is going on? Just can get out of this !! I even cannot log in with my API key!

---

<div class="post-metadata">

**Author:** ![DOMDOM](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@DOMDOM](https://community.plotly.com/u/DOMDOM)\
**Post date:** [November 25, 2016, 8:33am UTC](https://community.plotly.com/t/cannot-import-plotly-can-anyone-help-me-understand-that/2771/2 "2016-11-25T08:33:41Z")

</div>

Seems to have resolved the issuee after hours of head hacheee!!  
The problem was in a file .local/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py  
i changed permission to all the folder, and change the line 171 in the file, substituting extension with Extensions  
now seems to import plotly, i’ll tell you if it is gonna work! 🙂

EDIT:  
Nope… this seems not to work!! Why it has just worked feww minutes ago, and now is not going!! :S

---

<div class="post-metadata">

**Author:** ![DOMDOM](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@DOMDOM](https://community.plotly.com/u/DOMDOM)\
**Post date:** [November 26, 2016, 10:35am UTC](https://community.plotly.com/t/cannot-import-plotly-can-anyone-help-me-understand-that/2771/3 "2016-11-26T10:35:34Z")

</div>

Finally maneged to resolve completely the issue.  
The problem was with the python module cryptography, which was not updated.

just typed:

sudo pip install cryptography --update

and worked! 😃

---

<div class="post-metadata">

**Author:** ![chelsea](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chelsea/32/196_2.png) [@chelsea](https://community.plotly.com/u/chelsea)\
**Post date:** [November 29, 2016, 5:21pm UTC](https://community.plotly.com/t/cannot-import-plotly-can-anyone-help-me-understand-that/2771/4 "2016-11-29T17:21:16Z")

</div>

Closed on November 29, 2016, 5:21pm UTC


