ImportError: Unable to import the name "opentype" into a new installation

I just created the Google Cloud computing engine, installed the google-cloud package with pip and pip3, and when running the script with python3

I encountered the following error:
    from google.cloud import bigquery
  File "/usr/local/lib/python3.5/dist-packages/google/cloud/bigquery/__init__.py", line 35, 
in <module>
    from google.cloud.bigquery.client import Client
  File "/usr/local/lib/python3.5/dist-packages/google/cloud/bigquery/client.py", line 36, in
 <module>

(more traceback lines..)

    from pyasn1_modules.rfc2459 import Certificate
  File "/usr/local/lib/python3.5/dist-packages/pyasn1_modules/rfc2459.py", line 20, in <modu
le>
    from pyasn1.type import opentype
ImportError: cannot import name 'opentype'

The following packages are installed on the computing computer:

pyasn1==0.1.9
pyasn1-modules==0.2.1
google-cloud==0.30.0
google-cloud-bigquery==0.28.0

What problem could be here?

+6
source share
4 answers

It looks like you have a problem with pyasn1, so you can try installing a newer version (latest 0.4.2 ) or even reinstalling it manually using

sudo apt-get --reinstall install python-pyasn1 python-pyasn1-modules

And if you are inside virtualenv, use instead:

pip install pyasn1 pyasn1-modules
+14
+38

FWIW - - . , sudo .

- , ~/.local pyasn1, , opentype.py . - .

, - , ???

0

, :

pip install --upgrade google-auth-oauthlib
0
source

All Articles