1

The error that I'm facing is:

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

Which I thought was resolved by following the instructions in this stackoverflow answer:

sudo apt-get --reinstall install python-pyasn1 python-pyasn1-modules
pip3 install --upgrade google-auth-oauthlib

When I run my program via supervisorctl, sudo supervisorctl restart at_ussd I get the error above. However when I run my program via shell sudo python3 at_ussd.py, the program runs smoothly.

Please help me resolve this so that I can continue using supervisor for management!

Phil
  • 2,859
  • 5
  • 20
  • 21

1 Answers1

0

tl;dr; Search for multiple pyasn1/pyasn1-modules packages installed on your system.

From the traceback it looks like you have the latest pyasn1-modules (0.2.1) and some older (and incompatible) pyasn1 e.g. < 0.4.1 used together when you run it from superuserd.

However, when you run the program from you user shell, a compatible combination of pyasn1-modules/pyasn1 is picked up. It can be either older pyasn1-modules or newer pyasn1.

Ilya Etingof
  • 5,440
  • 1
  • 17
  • 21