oracle / oci-cli

Command Line Interface for Oracle Cloud Infrastructure
https://cloud.oracle.com/cloud-infrastructure
Other
443 stars 185 forks source link

ModuleNotFoundError: No module named 'cryptography' (on OL7) #600

Open wajiii opened 2 years ago

wajiii commented 2 years ago

We have an OL7 host on which we need to install the OCI CLI, so I followed the instructions given here, and ran sudo yum install python36-oci-cli.

This appeared to successfully install the CLI and its dependencies; however, trying to execute it afterward results in the error named in the subject of this issue:

[aime@phoenix41818 ~]$ which oci
/bin/oci

[aime@phoenix41818 ~]$ /bin/oci
Traceback (most recent call last):
  File "/bin/oci", line 5, in <module>
    import oci
  File "/usr/lib/python3.6/site-packages/oci/__init__.py", line 8, in <module>
    from . import auth, config, constants, decorators, exceptions, regions, pagination, retry, fips
  File "/usr/lib/python3.6/site-packages/oci/auth/__init__.py", line 5, in <module>
    from . import auth_utils  # noqa: F401
  File "/usr/lib/python3.6/site-packages/oci/auth/auth_utils.py", line 5, in <module>
    from oci._vendor import six
  File "/usr/lib/python3.6/site-packages/oci/_vendor/__init__.py", line 6, in <module>
    from . import httpsig_cffi  # noqa: F401
  File "/usr/lib/python3.6/site-packages/oci/_vendor/httpsig_cffi/__init__.py", line 7, in <module>
    from .sign import Signer, HeaderSigner  # noqa: F401
  File "/usr/lib/python3.6/site-packages/oci/_vendor/httpsig_cffi/sign.py", line 10, in <module>
    from cryptography.hazmat.backends import default_backend  # noqa: F401
ModuleNotFoundError: No module named 'cryptography'

[aime@phoenix41818 ~]$ echo EXITCODE=$?
EXITCODE=1

However, the installation clearly showed cryptography as one of the dependencies which was included at the time:

Installed:
  python36-oci-cli.noarch 0:3.15.1-1.el7

Dependency Installed:
  python3-jmespath.noarch 0:0.10.0-1.el7             python3-prompt-toolkit.noarch 0:3.0.29-1.0.2.el7  python36-arrow.noarch 0:1.1.1-1.el7         python36-certifi.noarch 0:2018.10.15-5.el7
  python36-cffi.x86_64 0:1.9.1-3.el7                 python36-circuitbreaker.noarch 0:1.3.1-1.el7      python36-cryptography.x86_64 0:3.2.1-1.el7  python36-dateutil.noarch 1:2.7.5-1.0.1.el7
  python36-idna.noarch 0:2.10-1.el7                  python36-oci-sdk.x86_64 0:2.80.0-1.el7            python36-ply.noarch 0:3.9-2.0.1.el7         python36-pycparser.noarch 0:2.14-2.el7
  python36-pytz.noarch 0:2017.2-3.0.2.el7            python36-pyyaml.x86_64 0:5.4.1-1.0.1.el7          python36-six.noarch 0:1.14.0-3.el7          python36-terminaltables.noarch 0:3.1.0-1.0.1.el7
  python36-typing-extensions.noarch 0:3.7.4.2-1.el7  python36-wcwidth.noarch 0:0.2.5-1.el7

I have removed and reinstalled the main package and its dependencies a number of times, hoping to resolve this; but I cannot get past it, and need help. ;)

mcepl commented 2 months ago

Could we get output of

 $ ls -d /usr/lib64/python3*/site-packages/[cC]*

and also

 $ rpm -V python36-cryptography

and while you are at it, try also

 $ python3.6
>>> import cryptography
>>> from cryptography.hazmat.backends import default_backend
>>> print(cryptography.__version__)
>>> print(default_backend.__code__)

Thank you.