ModuleNotFoundError: No module named 'cryptography' (on OL7)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 669
- Forks
- 236
- Avg merge
- 1m
- Merged PRs (30d)
- 4
Description
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. ;)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the OL7 installation with sudo yum install python36-oci-cli, then inspect /bin/oci and the Python 3.6 packages under /usr/lib/python3.6/site-packages. Done means the installed oci command starts without the reported cryptography import error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100