ImportError: cannot import name 'opentype' on new installation

前端 未结 3 1065
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-11 23:43

I\'ve just created a Google Cloud compute engine, installed google-cloud package with both pip and pip3, and I\'m experiencing the following error when launching a script wi

相关标签:
3条回答
  • 2021-01-12 00:08

    It looks like you have an issue with pyasn1, so you could try installing a newer version (the latest is 0.4.2), or even reinstalling it manually with:

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

    And if you are inside a virtualenv, use instead:

    pip install pyasn1 pyasn1-modules
    
    0 讨论(0)
  • 2021-01-12 00:09

    Posting my solution in case it helps someone else - this fixed it for me:

    pip install --upgrade google-auth-oauthlib

    More details discussed here: https://www.raspberrypi.org/forums/viewtopic.php?f=114&t=198933&p=1241439#p1241439

    0 讨论(0)
  • 2021-01-12 00:13

    FWIW - Had the same issue - none of the above worked. I eventually discovered that if I did it under sudo it did work.

    stracing the original - I found that I had a ~/.local directory which had a pyasn1 directory where it was trying to get the files from, but the opentype.py one did not appear there. When I deleted that whole directory - it started working.

    I assume it was some sort of cache that was partial, and out-of-date???

    0 讨论(0)
提交回复
热议问题