Title: [QUESTION] ImportError: cannot import name 'AsymmetricPadding' · Issue #2368 · python-telegram-bot/python-telegram-bot · GitHub
Open Graph Title: [QUESTION] ImportError: cannot import name 'AsymmetricPadding' · Issue #2368 · python-telegram-bot/python-telegram-bot
X Title: [QUESTION] ImportError: cannot import name 'AsymmetricPadding' · Issue #2368 · python-telegram-bot/python-telegram-bot
Description: Issue I am facing Receiving this error ImportError: cannot import name 'AsymmetricPadding' from partially initialized module 'cryptography.hazmat.primitives.asymmetric.padding' (most likely due to a circular import) (/Library/Frameworks/...
Open Graph Description: Issue I am facing Receiving this error ImportError: cannot import name 'AsymmetricPadding' from partially initialized module 'cryptography.hazmat.primitives.asymmetric.padding' (most likely due to ...
X Description: Issue I am facing Receiving this error ImportError: cannot import name 'AsymmetricPadding' from partially initialized module 'cryptography.hazmat.primitives.asymmetric.padding' (mos...
Opengraph URL: https://github.com/python-telegram-bot/python-telegram-bot/issues/2368
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[QUESTION] ImportError: cannot import name 'AsymmetricPadding'","articleBody":"### Issue I am facing\r\n\r\nReceiving this error\r\n\r\n```\r\nImportError: cannot import name 'AsymmetricPadding' from partially initialized module 'cryptography.hazmat.primitives.asymmetric.padding' (most likely due to a circular import) (/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py)\r\n```\r\n\r\nin [this](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot.py) official example script.\r\n\r\n_python-telegram-bot 13.2\r\nPython v3.9.1\r\npip v20.2.3\r\nMacOS v11.1 (20C69)_\r\n\r\n### Traceback to the issue\r\n```\r\nTraceback (most recent call last):\r\n File \"/Users/kirill/devbox/media_capture_bot/main.py\", line 3, in \u003cmodule>\r\n from telegram import Update\r\n File \"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/__init__.py\", line 51, in \u003cmodule>\r\n from .files.file import File\r\n File \"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/files/file.py\", line 28, in \u003cmodule>\r\n from telegram.passport.credentials import decrypt\r\n File \"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/passport/credentials.py\", line 29, in \u003cmodule>\r\n from cryptography.hazmat.primitives.asymmetric.padding import MGF1, OAEP\r\n File \"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py\", line 10, in \u003cmodule>\r\n from cryptography.hazmat.primitives.asymmetric import rsa\r\n File \"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py\", line 20, in \u003cmodule>\r\n from cryptography.hazmat.primitives.asymmetric.padding import AsymmetricPadding\r\nImportError: cannot import name 'AsymmetricPadding' from partially initialized module 'cryptography.hazmat.primitives.asymmetric.padding' (most likely due to a circular import) (/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py)\r\n```\r\n\r\n### Related part of your code\r\n```python\r\nimport logging\r\n\r\nfrom telegram import Update\r\nfrom telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext\r\n\r\n# Enable logging\r\nlogging.basicConfig(\r\n format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO\r\n)\r\n\r\nlogger = logging.getLogger(__name__)\r\n\r\n\r\n# Define a few command handlers. These usually take the two arguments update and\r\n# context. Error handlers also receive the raised TelegramError object in error.\r\ndef start(update: Update, context: CallbackContext) -> None:\r\n \"\"\"Send a message when the command /start is issued.\"\"\"\r\n update.message.reply_text('Hi!')\r\n\r\n\r\ndef help_command(update: Update, context: CallbackContext) -> None:\r\n \"\"\"Send a message when the command /help is issued.\"\"\"\r\n update.message.reply_text('Help!')\r\n\r\n\r\ndef echo(update: Update, context: CallbackContext) -> None:\r\n \"\"\"Echo the user message.\"\"\"\r\n update.message.reply_text(update.message.text)\r\n\r\n\r\ndef main():\r\n \"\"\"Start the bot.\"\"\"\r\n # Create the Updater and pass it your bot's token.\r\n updater = Updater(\"\u003cmy Telegram bot token here>\")\r\n\r\n # Get the dispatcher to register handlers\r\n dispatcher = updater.dispatcher\r\n\r\n # on different commands - answer in Telegram\r\n dispatcher.add_handler(CommandHandler(\"start\", start))\r\n dispatcher.add_handler(CommandHandler(\"help\", help_command))\r\n\r\n # on noncommand i.e message - echo the message on Telegram\r\n dispatcher.add_handler(MessageHandler(Filters.text & ~Filters.command, echo))\r\n\r\n # Start the Bot\r\n updater.start_polling()\r\n\r\n # Run the bot until you press Ctrl-C or the process receives SIGINT,\r\n # SIGTERM or SIGABRT. This should be used most of the time, since\r\n # start_polling() is non-blocking and will stop the bot gracefully.\r\n updater.idle()\r\n\r\n\r\nif __name__ == '__main__':\r\n main()\r\n```\r\n\r\nThanks in advance!","author":{"url":"https://github.com/k-vishnevsky","@type":"Person","name":"k-vishnevsky"},"datePublished":"2021-02-08T09:06:18Z","url":"https://github.com/python-telegram-bot/python-telegram-bot/issues/2368"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:debe7f87-83bb-674b-a567-af31994369e7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFB8:38E318:42D8475:545C354:6B025F2D |
| html-safe-nonce | cc855a8a8a485ac0da36e432d5b385db310406e8f65c4f462a3348300d4213fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkI4OjM4RTMxODo0MkQ4NDc1OjU0NUMzNTQ6NkIwMjVGMkQiLCJ2aXNpdG9yX2lkIjoiNTAzOTIwNjEyNDI2ODcwNzYyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2ef8072710a92680f7193ef2adfa2e4a9090872aaeb70e69b3edf8e5b34330dd |
| hovercard-subject-tag | issue:803356396 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-telegram-bot/python-telegram-bot/2368/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6c51d506c1cecfc095ad168a7cc68c53b0b265d00eea5ede0bf8108fbf79bfbf/python-telegram-bot/python-telegram-bot/issues/2368 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6c51d506c1cecfc095ad168a7cc68c53b0b265d00eea5ede0bf8108fbf79bfbf/python-telegram-bot/python-telegram-bot/issues/2368 |
| og:image:alt | Issue I am facing Receiving this error ImportError: cannot import name 'AsymmetricPadding' from partially initialized module 'cryptography.hazmat.primitives.asymmetric.padding' (most likely due to ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | k-vishnevsky |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-telegram-bot/python-telegram-bot git https://github.com/python-telegram-bot/python-telegram-bot.git |
| octolytics-dimension-user_id | 16178365 |
| octolytics-dimension-user_login | python-telegram-bot |
| octolytics-dimension-repository_id | 38696925 |
| octolytics-dimension-repository_nwo | python-telegram-bot/python-telegram-bot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38696925 |
| octolytics-dimension-repository_network_root_nwo | python-telegram-bot/python-telegram-bot |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width