v22.1.0 ERROR: deprecated() got an unexpected keyword argument 'name'
Closed this issue ยท 21 comments
Same issue spotted with awscli==1.22.24
Got this after ArchLinux upgrade: python-cryptography=38.0.1-1
, python-pyopenssl=22.1.0-1
. Completely broke gajim app.
This error cannot occur if you're actually using pyopenssl 22.1, so despite upgrading your OS package you're using an older version somewhere.
okay turns out i had cryptography=36.0.2
installed as user package.
I too facing same issue, any solutions?
We've downgraded as a temporary workaround in case it helps anyone else:
pyOpenSSL==22.0.0 # TODO: Issue with 22.1 https://github.com/pyca/pyopenssl/issues/1154
This is not a bug in pyOpenSSL 22.1. pyOpenSSL 22.1 unambiguously specifies a dependency on cryptography>=38.0.0,<39
:
Lines 97 to 100 in d7e539c
I'm not sure how y'all end up installing pyOpenSSL 22.1 without also installing a compatible version of cryptography, but it's definitely not a bug in pyOpenSSL but a problem with how you install/upgrade your Python packages.
I can confirm that
pip3 install cryptography --upgrade
pip3 install pyOpenSSL --upgrade
breaks awscli on MacOS.
Downgrading pyOpenSSL fixes it:
pip3 install pyOpenSSL==22.0.0
This is the error:
~ % aws --version
Traceback (most recent call last):
File "/usr/local/bin/aws", line 19, in <module>
import awscli.clidriver
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/clidriver.py", line 20, in <module>
import botocore.session
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/session.py", line 27, in <module>
import botocore.client
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/client.py", line 16, in <module>
from botocore import UNSIGNED, waiter, xform_name
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/waiter.py", line 17, in <module>
from botocore.docs.docstring import WaiterDocstring
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/docs/__init__.py", line 15, in <module>
from botocore.docs.service import ServiceDocumenter
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/docs/service.py", line 14, in <module>
from botocore.docs.client import ClientDocumenter, ClientExceptionsDocumenter
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/docs/client.py", line 16, in <module>
from botocore.docs.example import ResponseExampleDocumenter
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/docs/example.py", line 13, in <module>
from botocore.docs.shape import ShapeDocumenter
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/docs/shape.py", line 19, in <module>
from botocore.utils import is_json_value_header
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/utils.py", line 32, in <module>
import botocore.httpsession
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/httpsession.py", line 41, in <module>
from urllib3.contrib.pyopenssl import orig_util_SSLContext as SSLContext
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
import OpenSSL.SSL
File "/usr/local/lib/python3.10/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import SSL, crypto
File "/usr/local/lib/python3.10/site-packages/OpenSSL/SSL.py", line 19, in <module>
from OpenSSL.crypto import (
File "/usr/local/lib/python3.10/site-packages/OpenSSL/crypto.py", line 3224, in <module>
utils.deprecated(
TypeError: deprecated() got an unexpected keyword argument 'name'
This can happen if you install incompatible versions of pyOpenSSL and cryptography in separate pip instructions like
pip install pyOpenSSL==22.1.0
pip install cryptography==3.0
During the second install transaction, you will see
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pyopenssl 22.1.0 requires cryptography<39,>=38.0.0, but you have cryptography 3.0 which is incompatible.
Had you installed both in a single instruction, you would have run into an installation error instead
pip install cryptography==3.0 pyOpenSSL==22.1.0
...
ERROR: Cannot install cryptography==3.0 and pyopenssl==22.1.0 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested cryptography==3.0
pyopenssl 22.1.0 depends on cryptography<39 and >=38.0.0
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
So that's it:
- fix you install scripts
- upgrade your setups, holy fuck
@n1ngu
cryptography uninstalled:
~ % pip3 uninstall cryptography
Found existing installation: cryptography 38.0.1
Uninstalling cryptography-38.0.1:
Would remove:
/usr/local/lib/python3.10/site-packages/cryptography-38.0.1.dist-info/*
/usr/local/lib/python3.10/site-packages/cryptography/*
Proceed (Y/n)?
Successfully uninstalled cryptography-38.0.1
pyOpenSSL uninstalled:
~ % pip3 uninstall pyOpenSSL
Found existing installation: pyOpenSSL 22.0.0
Uninstalling pyOpenSSL-22.0.0:
Would remove:
/usr/local/lib/python3.10/site-packages/OpenSSL/*
/usr/local/lib/python3.10/site-packages/pyOpenSSL-22.0.0.dist-info/*
Proceed (Y/n)?
Successfully uninstalled pyOpenSSL-22.0.0
pyOpenSSL installed, what automatically installs the right version of cryptography
~ % pip3 install pyOpenSSL
Collecting pyOpenSSL
Using cached pyOpenSSL-22.1.0-py3-none-any.whl (57 kB)
Collecting cryptography<39,>=38.0.0
Using cached cryptography-38.0.1-cp36-abi3-macosx_10_10_x86_64.whl (2.8 MB)
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.10/site-packages (from cryptography<39,>=38.0.0->pyOpenSSL) (1.15.1)
Requirement already satisfied: pycparser in /usr/local/lib/python3.10/site-packages (from cffi>=1.12->cryptography<39,>=38.0.0->pyOpenSSL) (2.21)
Installing collected packages: cryptography, pyOpenSSL
Successfully installed cryptography-38.0.1 pyOpenSSL-22.1.0
awscli still broken with cryptography-38.0.1 and pyOpenSSL-22.1.0:
~ % aws --version
Traceback (most recent call last):
File "/usr/local/bin/aws", line 19, in <module>
import awscli.clidriver
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/clidriver.py", line 20, in <module>
import botocore.session
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/session.py", line 27, in <module>
import botocore.client
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/client.py", line 16, in <module>
from botocore import UNSIGNED, waiter, xform_name
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/waiter.py", line 17, in <module>
from botocore.docs.docstring import WaiterDocstring
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/docs/__init__.py", line 15, in <module>
from botocore.docs.service import ServiceDocumenter
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/docs/service.py", line 14, in <module>
from botocore.docs.client import ClientDocumenter, ClientExceptionsDocumenter
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/docs/client.py", line 16, in <module>
from botocore.docs.example import ResponseExampleDocumenter
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/docs/example.py", line 13, in <module>
from botocore.docs.shape import ShapeDocumenter
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/docs/shape.py", line 19, in <module>
from botocore.utils import is_json_value_header
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/utils.py", line 32, in <module>
import botocore.httpsession
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/httpsession.py", line 41, in <module>
from urllib3.contrib.pyopenssl import orig_util_SSLContext as SSLContext
File "/usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
import OpenSSL.SSL
File "/usr/local/lib/python3.10/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import SSL, crypto
File "/usr/local/lib/python3.10/site-packages/OpenSSL/SSL.py", line 19, in <module>
from OpenSSL.crypto import (
File "/usr/local/lib/python3.10/site-packages/OpenSSL/crypto.py", line 3224, in <module>
utils.deprecated(
TypeError: deprecated() got an unexpected keyword argument 'name'
I'm facing the same error. I tried to uninstall the packages like examples above but the error is also happening when I use pip3 install/uninstall. I'm using ubuntu 20.04.5. deprecated() got an unexpected keyword argument 'name'
Any suggestions ?
These issues are almost certainly caused by version mismatches. For example, in the stack trace provided by @nicolamarangoni AWS CLI is loading libraries out of at least two different site-packages
directories. In fact, looking at an install of awscli
in homebrew on my laptop I see that it installs cryptography
36.0.2. When awscli attempts to load libraries it is loading version 36 from that. botocore
then attempts to opportunistically import pyOpenSSL
through urllib3
for some fallback behavior, but that's not necessary functionality and it will eat the ImportError
if the library is not present.
Unfortunately, this doesn't fail with the way homebrew has this packaged (since the awscli site-packages are not entirely isolated) and so it imports pyOpenSSL
from the site packages that your pip
installs to. cryptography
38 was installed into the same site-packages directory as pyOpenSSL
, but is not the version that is loaded, which causes this exception.
There are a few fixes possible here, listed in order of how robust they would be
- Figure out how to make homebrew formulas entirely isolated from the
site-packages
of the parent Python installation. - Investigate if the pyopenssl fallback behavior in botocore is still needed for any scenarios and remove it entirely if not.
- Upgrade awscli to use cryptography 38
- Uninstall pyOpenSSL if you don't need it
- Downgrade to pyOpenSSL 22.0 (very fragile!)
Any of those options will "fix" this particular problem, but only the first will prevent any possible problems in the future. However, that one is also likely to be the most challenging so I'd suggest folks affected by this who know they need pyOpenSSL pursue both option 1 and 3.
Homebrew guys are informed and will correct their awscli distribution.
This fixes the issue temporarily:
~ % /usr/local/Cellar/awscli/2.7.31/libexec/bin/python -m pip install cryptography --upgrade
Requirement already satisfied: cryptography in /usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages (36.0.2)
Collecting cryptography
Using cached cryptography-38.0.1-cp36-abi3-macosx_10_10_x86_64.whl (2.8 MB)
Requirement already satisfied: cffi>=1.12 in /usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages (from cryptography) (1.15.1)
Requirement already satisfied: pycparser in /usr/local/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages (from cffi>=1.12->cryptography) (2.21)
Installing collected packages: cryptography
Attempting uninstall: cryptography
Found existing installation: cryptography 36.0.2
Uninstalling cryptography-36.0.2:
Successfully uninstalled cryptography-36.0.2
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
awscli 2.7.31 requires awscrt<=0.14.0,>=0.12.4, but you have awscrt 0.14.3 which is incompatible.
awscli 2.7.31 requires cryptography<37.0.0,>=3.3.2, but you have cryptography 38.0.1 which is incompatible.
Successfully installed cryptography-38.0.1
I have highlighted issue here
Even pip uninstall pip
does not work. Any command with pip
throws an error.
Same here, one of the apache airflow provider packages I use to set up a managed airflow locally with docker, seems to install OpenSSL==22.1.0.
As a workaround, n the bootstrap.sh file, I set:
pip3 install pyOpenSSL==22.0.0
that fixed the issue.
pip3 install pyOpenSSL==22.0.0
Thank you!
If you cannot run pip uninstall pyOpenSSL
command, have a try:
cd /usr/local/lib/python3.8/dist-packages/
sudo rm -rf OpenSSL
sudo rm -rf pyOpenSSL-23.1.1.dist-info
pip3 install pyOpenSSL
I applied one by one all solution but not resolved same error faced
import boto3
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/boto3/__init__.py", line 17, in <module>
from boto3.session import Session
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/boto3/session.py", line 17, in <module>
import botocore.session
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/botocore/session.py", line 26, in <module>
import botocore.client
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/botocore/client.py", line 15, in <module>
from botocore import waiter, xform_name
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/botocore/waiter.py", line 18, in <module>
from botocore.docs.docstring import WaiterDocstring
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/botocore/docs/__init__.py", line 15, in <module>
from botocore.docs.service import ServiceDocumenter
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/botocore/docs/service.py", line 14, in <module>
from botocore.docs.client import ClientDocumenter, ClientExceptionsDocumenter
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/botocore/docs/client.py", line 14, in <module>
from botocore.docs.example import ResponseExampleDocumenter
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/botocore/docs/example.py", line 13, in <module>
from botocore.docs.shape import ShapeDocumenter
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/botocore/docs/shape.py", line 19, in <module>
from botocore.utils import is_json_value_header
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/botocore/utils.py", line 34, in <module>
import botocore.httpsession
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/botocore/httpsession.py", line 41, in <module>
from urllib3.contrib.pyopenssl import orig_util_SSLContext as SSLContext
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
import OpenSSL.crypto
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import SSL, crypto
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/OpenSSL/SSL.py", line 34, in <module>
from OpenSSL.crypto import (
File "/home/workspace/.local/share/virtualenvs/workspace-hArTflJD/lib/python3.8/site-packages/OpenSSL/crypto.py", line 945, in <module>
utils.deprecated(
TypeError: deprecated() got an unexpected keyword argument 'name'