-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModuleNotFoundError: No module named '_cffi_backend' #138
Comments
Search for |
(venv_atc) [root@ncerndatclnx01 ~]# ls -al /var/www/html/venv_atc/lib/python3.7/site-packages/ | grep -i _cffi_backend* It is present |
Sorry, I don't know. Maybe ask on other platforms like StackOverflow? It doesn't make much sense that most modules inside this directory can be imported (at least all the ones shown in the traceback) but this precise one cannot. Maybe try to do |
Are you actually running on a x86_64 instance? For instance what does this show?
|
(venv_atc) [root@ncerndatclnx01 html]# python3 -c "import _ssl; print(_ssl)" |
OK, that is promising, at least your CPython can import c-extension modules. If `python3 -c "import _cffi_backend" fails, does it print out any more information? |
(venv_atc) [root@ncerndatclnx01 html]# python3 -c "import _cffi_backend" No error occurred! |
@mattip Note that the paths printed by @Firdouse532 How did you get the list of installed modules you posted in the first message? |
I have performed pip freeze within the venv created for this project. |
That would indicate you are not using the same python in these checks and in Can you try the steps I mentioned above again with the python at |
(venv_atc) [root@ncerndatclnx01 html]# /var/www/html/venv_atc/bin/python -c "import _cffi_backend" (venv_atc) [root@ncerndatclnx01 html]# /var/www/html/venv_atc/bin/python3 -c "import _ssl; print(_ssl)" |
And what about: |
@Firdouse532 I am out of ideas. I still claim you are running a different python from
I know nothing about how this is supposed to work. I would start by modifying the script |
Note as per your comment that the venv in |
Sure, Maybe I will check with different forums of django or Apache. Thanks for your help @mattip |
[suser@ncerndatclnx01 ~]$ /var/www/html/venv_atc/bin/python -c "import OpenSSL"
|
mod_wsgi (pid=2135587): Failed to exec Python script file '/var/www/html/atc/atc/wsgi.py'.
mod_wsgi (pid=2135587): Exception occurred processing WSGI script '/var/www/html/atc/atc/wsgi.py'.
Traceback (most recent call last):
File "/var/www/html/atc/atc/wsgi.py", line 29, in
application = get_wsgi_application()
File "/var/www/html/venv_atc/lib/python3.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
return WSGIHandler()
File "/var/www/html/venv_atc/lib/python3.7/site-packages/django/core/handlers/wsgi.py", line 127, in init
self.load_middleware()
File "/var/www/html/venv_atc/lib/python3.7/site-packages/django/core/handlers/base.py", line 35, in load_middleware
middleware = import_string(middleware_path)
File "/var/www/html/venv_atc/lib/python3.7/site-packages/django/utils/module_loading.py", line 17, in import_string
module = import_module(module_path)
File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/var/www/html/venv_atc/lib/python3.7/site-packages/mozilla_django_oidc/middleware.py", line 12, in
from mozilla_django_oidc.auth import OIDCAuthenticationBackend
File "/var/www/html/venv_atc/lib/python3.7/site-packages/mozilla_django_oidc/auth.py", line 16, in
from josepy.b64 import b64decode
File "/var/www/html/venv_atc/lib/python3.7/site-packages/josepy/init.py", line 41, in
from josepy.interfaces import JSONDeSerializable
File "/var/www/html/venv_atc/lib/python3.7/site-packages/josepy/interfaces.py", line 6, in
from josepy import errors, util
File "/var/www/html/venv_atc/lib/python3.7/site-packages/josepy/util.py", line 4, in
import OpenSSL
File "/var/www/html/venv_atc/lib/python3.7/site-packages/OpenSSL/init.py", line 8, in
from OpenSSL import crypto, SSL
File "/var/www/html/venv_atc/lib/python3.7/site-packages/OpenSSL/crypto.py", line 17, in
from OpenSSL._util import (
File "/var/www/html/venv_atc/lib/python3.7/site-packages/OpenSSL/_util.py", line 6, in
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/var/www/html/venv_atc/lib/python3.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 14, in
from cryptography.hazmat.bindings._openssl import ffi, lib
ModuleNotFoundError: No module named '_cffi_backend'
appdirs==1.4.4
asgiref==3.3.4
attrs==21.1.0
autoit==0.2.3
cached-property==1.5.2
certifi==2020.12.5
cffi==1.15.1
chardet==4.0.0
click==7.1.2
cryptography==3.4.7
dataclasses==0.6
defusedxml==0.7.1
distlib==0.3.9
Django==3.0.5
django-multiselectfield==0.1.12
djongo==1.3.4
elastic-transport==8.4.1
elasticsearch==7.12.0
filelock==3.12.2
greenlet==1.0.0
gunicorn==23.0.0
idna==2.10
importlib-metadata==6.6.0
isodate==0.6.0
joblib==1.0.1
josepy==1.8.0
lxml==4.6.3
mod-wsgi==4.9.4
mozilla-django-oidc==1.2.4
multi-key-dict==2.0.3
mysql-connector-python==8.0.23
nltk==3.5
numpy==1.20.2
packaging==24.0
pandas==1.2.3
pbr==5.5.1
Pillow==8.1.2
pipdeptree==2.9.6
platformdirs==4.0.0
protobuf==3.15.8
psutil==5.8.0
pyasn1==0.5.1
PyAutoIt==0.6.5
pycparser==2.21
pymongo==3.12.3
pymsteams==0.1.14
pyOpenSSL==20.0.1
python-dateutil==2.8.1
python-jenkins==1.7.0
pytz==2021.1
rauth==0.7.3
regex==2021.4.4
requests==2.25.1
requests-file==1.5.1
requests-toolbelt==0.9.1
selenium==3.141.0
six==1.16.0
SQLAlchemy==1.4.4
sqlparse==0.2.4
tqdm==4.60.0
typing_extensions==4.7.1
urllib3==1.26.2
virtualenv==20.26.6
zeep==4.0.0
zipp==3.4.1
Python 3.7 is the current one with RHEL 8 server.
The text was updated successfully, but these errors were encountered: