Skip to content
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

TypeError: deprecated() got an unexpected keyword argument 'name' #7325

Closed
richstokes opened this issue Oct 5, 2022 · 13 comments
Closed

TypeError: deprecated() got an unexpected keyword argument 'name' #7325

richstokes opened this issue Oct 5, 2022 · 13 comments
Assignees
Labels
bug This issue is a bug. installation third-party This issue is related to third-party libraries or applications.

Comments

@richstokes
Copy link

Describe the bug

Installed via brew install awscli, getting:

aws

Traceback (most recent call last):
  File "/opt/homebrew/bin/aws", line 19, in <module>
    import awscli.clidriver
  File "/opt/homebrew/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/clidriver.py", line 20, in <module>
    import botocore.session
  File "/opt/homebrew/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/session.py", line 27, in <module>
    import botocore.client
  File "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/awscli/botocore/utils.py", line 32, in <module>
    import botocore.httpsession
  File "/opt/homebrew/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 "/opt/homebrew/Cellar/awscli/2.7.31/libexec/lib/python3.10/site-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
    import OpenSSL.SSL
  File "/Users/rich/Library/Python/3.10/lib/python/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import SSL, crypto
  File "/Users/rich/Library/Python/3.10/lib/python/site-packages/OpenSSL/SSL.py", line 19, in <module>
    from OpenSSL.crypto import (
  File "/Users/rich/Library/Python/3.10/lib/python/site-packages/OpenSSL/crypto.py", line 3224, in <module>
    utils.deprecated(
TypeError: deprecated() got an unexpected keyword argument 'name'

Expected Behavior

Not error

Current Behavior

see above

Reproduction Steps

see above

Possible Solution

No response

Additional Information/Context

Python 3.10.7

brew info awscli                                                            

==> awscli: stable 2.7.31 (bottled), HEAD
Official Amazon AWS command-line interface
https://aws.amazon.com/cli/
/opt/homebrew/Cellar/awscli/2.7.31 (12,785 files, 104.3MB) *
  Poured from bottle on 2022-10-05 at 11:17:09
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/awscli.rb
License: Apache-2.0
==> Dependencies
Build: cmake ✔, rust ✘
Required: [email protected] ✔, six ✔
==> Options
--HEAD
	Install HEAD version
==> Caveats
The "examples" directory has been installed to:
  /opt/homebrew/share/awscli/examples

zsh completions and functions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Analytics
install: 174,547 (30 days), 681,760 (90 days), 2,614,888 (365 days)
install-on-request: 172,229 (30 days), 671,892 (90 days), 2,586,882 (365 days)
build-error: 51 (30 days)

CLI version used

2.7.31

Environment details (OS name and version, etc.)

MacOS 12.6, Apple Silicon

@richstokes richstokes added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 5, 2022
@richstokes
Copy link
Author

pip3 uninstall pyOpenSSL fixed it, must have been some kind of local conflict

@tim-finnigan tim-finnigan added third-party This issue is related to third-party libraries or applications. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 5, 2022
@tim-finnigan
Copy link
Contributor

Hi @richstokes thanks for reporting this. It's something that the team will need to look further into. In the meantime uninstalling pyOpenSSL fixes the issue as you mentioned or you could downgrade pyOpenSSL to 22.0.0 as referenced in a comment from the issue you linked. If anyone else is affected by this please 👍 this issue and leave a comment if you had any additional info to share.

@reaperhulk
Copy link

reaperhulk commented Oct 6, 2022

pyca/pyopenssl#1154 (comment) explains why this is happening (to at least the subset of users who are installing awscli via homebrew, but likely other similar scenarios as well).

Additionally, as a cryptography developer I'd recommend that awscli update their cryptography dependency to <39, which would technically "fix" this, but is not the true cause.

@tim-finnigan
Copy link
Contributor

Hi @reaperhulk thanks for checking in here. Brew installation isn't officially supported per the AWS CLI documentation but the team can look into increasing the ceiling for the cryptography package as you suggested. (We also have a tracking issue open for updating the version ranges of several dependencies which I'll link here: #5943.)

A more long-term fix would likely require involvement on brew's side and updating how the packaging is done. And the brew team would need to update their pin on cryptography as well once the ceiling is updated for the CLI. Also the CLI/botocore don't use pyOpenSSL but this comment provides more context on the relationship between pyOpenSSL and urllib3: boto/botocore#2744 (comment)

@tim-finnigan
Copy link
Contributor

Update: #7329 was just merged to increase the version range for cryptography. This should unblock the homebrew team once it is released tomorrow to raise their pin as well

@tim-finnigan
Copy link
Contributor

Since uninstalling pyOpenSSL resolves the original issue reported I'm going to close this.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

@stoccalino
Copy link

I opened a new issue regarding this problem, I can't solve with the solutions provided here.
Please see : #7607

@qingzheng-web
Copy link

But when I use the command "pip3 uninstall pyOpenSSL",it still throws the error "TypeError: deprecated() got an unexpected keyword argument 'name'".And even I execute "pip -V",it throws the error too.It sounds sadly.I would try to uninstall python3.8 which I am using and install python3.10.

@rai-usman
Copy link

But when I use the command "pip3 uninstall pyOpenSSL",it still throws the error "TypeError: deprecated() got an unexpected keyword argument 'name'".And even I execute "pip -V",it throws the error too.It sounds sadly.I would try to uninstall python3.8 which I am using and install python3.10.

Just go to this path:
cd ~/.local/lib/python3.8/site-packages
and simply delete OpenSSL:
rm -r OpenSSL

@Momin9
Copy link

Momin9 commented Nov 15, 2023

@richstokes
Not Fixed with this command pip3 uninstall pyOpenSSL I already not install

@sryze
Copy link

sryze commented Nov 23, 2023

For Windows users: who are getting this error with sam:

Go to C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages and rename or delete the OpenSSL folder

@jiaohuix
Copy link

But when I use the command "pip3 uninstall pyOpenSSL",it still throws the error "TypeError: deprecated() got an unexpected keyword argument 'name'".And even I execute "pip -V",it throws the error too.It sounds sadly.I would try to uninstall python3.8 which I am using and install python3.10.

Just go to this path: cd ~/.local/lib/python3.8/site-packages and simply delete OpenSSL: rm -r OpenSSL

thx!!! it works~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. installation third-party This issue is related to third-party libraries or applications.
Projects
None yet
Development

No branches or pull requests

9 participants