Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import datasets #12

Closed
immuntasir opened this issue Jul 13, 2018 · 2 comments
Closed

Cannot import datasets #12

immuntasir opened this issue Jul 13, 2018 · 2 comments

Comments

@immuntasir
Copy link

immuntasir commented Jul 13, 2018

ImportError Traceback (most recent call last)

in ()
----> 1 import datasheets

/usr/local/lib/python3.5/dist-packages/datasheets/init.py in ()
11 """
12 from datasheets import exceptions
---> 13 from datasheets.client import Client
14 from datasheets.convenience import create_tab_in_new_workbook, create_tab_in_existing_workbook
15 from datasheets.helpers import convert_cell_index_to_label, convert_cell_label_to_index

/usr/local/lib/python3.5/dist-packages/datasheets/client.py in ()
8 import apiclient
9 import oauth2client
---> 10 from oauth2client.service_account import ServiceAccountCredentials
11 import pandas as pd
12

/usr/local/lib/python3.5/dist-packages/oauth2client/service_account.py in ()
24 from oauth2client import _helpers
25 from oauth2client import client
---> 26 from oauth2client import crypt
27 from oauth2client import transport
28

/usr/local/lib/python3.5/dist-packages/oauth2client/crypt.py in ()
21
22 from oauth2client import _helpers
---> 23 from oauth2client import _pure_python_crypt
24
25

/usr/local/lib/python3.5/dist-packages/oauth2client/_pure_python_crypt.py in ()
22 from pyasn1.codec.der import decoder
23 from pyasn1_modules import pem
---> 24 from pyasn1_modules.rfc2459 import Certificate
25 from pyasn1_modules.rfc5208 import PrivateKeyInfo
26 import rsa

/usr/local/lib/python3.5/dist-packages/pyasn1_modules/rfc2459.py in ()
18 from pyasn1.type import namedtype
19 from pyasn1.type import namedval
---> 20 from pyasn1.type import opentype
21 from pyasn1.type import tag
22 from pyasn1.type import univ

ImportError: cannot import name 'opentype'

I have tried upgrading the pyasn and pyasn1_modules library, but to no avail.

pip list | grep "google"

google-api-core (1.2.1)
google-api-python-client (1.7.4)
google-auth (1.5.0)
google-auth-httplib2 (0.0.3)
google-cloud-bigquery (1.3.0)
google-cloud-core (0.28.1)
google-resumable-media (0.3.1)
googleapis-common-protos (1.5.3)

pip list | grep "pyasn"

pyasn (1.6.0b1)
pyasn1 (0.4.3)
pyasn1-modules (0.2.2)

@zcmarine
Copy link
Contributor

Hey,

Interesting. Since pyasn1 and pyasn1_modules are dependencies of a dependency (oauth2client), my first thought is that you may be reusing a virtual environment that already has an outdated versions of those libraries and is causing trouble. An alternative that would have the same effect is if you have them installed at the system level. I looked around a bit and it seems like that's typically been the case when others have had this issue. A couple things that would be useful:

  1. Try creating a new virtual environment, make sure that pip freeze doesn't return either of those pyasn1 modules, and then install datasheets in there. I have a hunch that would solve it.

  2. Follow the advice in either of these GitHub issues: first, second. Both basically amount to upgrading those packages within your existing environment.

In either case, I'd be interested to see the output of a pip freeze | grep pyasn1 both in the offending environment and in one you can get working. This issue hasn't come up before, but it may be prudent for us to put a minimum version for these transitive dependencies just to avoid this.

Hope that helps!

@zcmarine
Copy link
Contributor

Hey @immuntasir, given that there hasn't been any more activity on this issue in last couple months I'm gonna close it on the assumption that the above resolved the problem. If it didn't, please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants