Здравствуйте, я новичок в Python. Получаю DeprecationWarning о том, что использование или импорт ABC через 'collections' вместо collections.abc перестанет работать в Python 3.10
import pymssql as pymssql
Покажите полный traceback получаемого исключения. Скорее всего, дело не в написанном вами коде, а внутри pymssql, поскольку сторонние пакеты, к сожалению, довольно часто выдают подобные предупреждения, и нужно проследить traceback, чтобы точно установить источник именно этого предупреждения.
Ещё я заметил, что, похоже, доступна более новая версия pymssql. Без необходимых компонентов я не могу установить ни вашу версию, ни новую, но обновление стоит рассмотреть. (Кстати, список “Releases” в GitHub проекта (https://github.com/pymssql/pymssql/) вводит в заблуждение: после 2020 года там, похоже, ничего не публиковали. Тем не менее разработка в этом репозитории, судя по всему, продолжается активно.) Я нашёл закрытый issue (https://github.com/pymssql/pymssql/issues/576) именно об этом предупреждении, где говорится, что исправление вошло в 2.1.5, поэтому обновление до 2.1.x или 2.3 вполне может решить проблему.
Переведено с английского·Показать оригинал
Hello, Python is new to me. I'm seeing DeprecationWarning saying that using or importing ABCs through 'collections' rather than collections.abc wont work in Python 3.10
import pymssql as pymssql
Please share the entire exception traceback you're getting. Most probably it isn't something in the code you've written yourself, but something inside pymssql, since it is unfortunately quite common for third-party packages to produce warnings like this, and you need to follow the traceback to establish exactly where this one originates.
I also noticed that a newer version of pymssql appears to be available. Without the required prerequisites I can't install your version or the newer one, although considering an upgrade seems worthwhile. (Incidentally, the project's GitHub (https://github.com/pymssql/pymssql/) “Releases” list is misleading, with apparently no releases published there after 2020. Development nevertheless seems active in that repository.) I found a closed issue (https://github.com/pymssql/pymssql/issues/576) describing this very warning, which says version 2.1.5 contains the fix, making an upgrade to either 2.1.x or 2.3 a promising solution.