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

DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working #1401

Closed
The-Compiler opened this issue Jun 27, 2018 · 18 comments
Labels

Comments

@The-Compiler
Copy link

In Python 3.7, importing ABCs directly from the collections module shows a
warning (and in Python 3.8 it will stop working) - see
python/cpython@c66f9f8

.../site-packages/pkg_resources/_vendor/pyparsing.py:943: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  collections.MutableMapping.register(ParseResults)

.../site-packages/pkg_resources/_vendor/pyparsing.py:3226: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  elif isinstance( exprs, collections.Iterable ):

I'd be happy to help with fixing this, but it looks like pyparsing.py is vendored from upstream - I'll open an issue there as well, but that project looks quite inactive...

@The-Compiler
Copy link
Author

Ah, looks like there's https://sourceforge.net/p/pyparsing/bugs/106/ already (and pypa/pip#5013 too)

@hugovk
Copy link
Contributor

hugovk commented Aug 9, 2018

PyParsing has moved to GitHub. Here's a PR for it: pyparsing/pyparsing#16.

@tirkarthi
Copy link
Contributor

PyParsing release with the fix : https://github.com/pyparsing/pyparsing/releases/tag/pyparsing_2.2.1

Thanks

@hugovk
Copy link
Contributor

hugovk commented Sep 21, 2018

PyParsing has been updated to 2.2.1 in Setuptools in d4b5eb6.

This issue can be closed.

@jaraco
Copy link
Member

jaraco commented Sep 21, 2018

Released in 40.4.1.

@jaraco jaraco closed this as completed Sep 21, 2018
@5j9
Copy link

5j9 commented Sep 23, 2018

PyParsing has been updated to 2.2.1 in Setuptools in d4b5eb6.

This issue can be closed.

The version in _vendor directory is still 2.2.0 and I'm still getting the warning while using 40.4.2.

__version__ = "2.2.0"

@5j9
Copy link

5j9 commented Sep 23, 2018

There are two copies of pyparsing.py in the repository. One in the pkg_resources/_vendor and one in setuptools/_vendor. Only the second one has been updated.

@jaraco
Copy link
Member

jaraco commented Sep 23, 2018

:/

At one point, the setuptools package would re-use the vendored dependencies from the pkg_resources package. I suspect these were split as part of the effort to see pkg_resources split out as a separate package.

@jaraco jaraco reopened this Sep 23, 2018
@pganssle pganssle added the Needs Triage Issues that need to be evaluated for severity and status. label Oct 19, 2018
@pganssle
Copy link
Member

I think this was fixed in 2862b90.

@pganssle pganssle added bug and removed Needs Triage Issues that need to be evaluated for severity and status. labels Oct 23, 2018
@cepbrian
Copy link

Why am I still getting this warning? I'm using 2.10 and pyparsing 2.3.1

@pganssle
Copy link
Member

@cepbrian What does "2.10" refer to there?

@cepbrian
Copy link

cepbrian commented Mar 1, 2019

2.10 is the version of jinja2 I'm using.

> import jinja2
>> print (jinja2.__version__)
2.10

@tirkarthi
Copy link
Contributor

jinja doesn't seem to be a part of setuptools. This warning was fixed in jinja's master branch but not released yet : pallets/jinja#867

@cepbrian
Copy link

cepbrian commented Mar 1, 2019

It was fixed in October, but not released yet? Can we get it released?

@tirkarthi
Copy link
Contributor

Please follow up with jinja project tracker since setuptools cannot do anything about the release timeline.

Thanks

@VikneshSK
Copy link

I hope this issue has started again!

Error: C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils_init_.py:4:
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Sequence

C:\ProgramData\Anaconda3\lib\site-packages\sklearn\model_selection_split.py:18:
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Iterable

I have Scikit-learn & Pyparsing versions:
In [14]: pyparsing.__version__
Out[14]: '2.4.6'
sklearn.__version__
Out[19]: '0.19.1'

Should i rollback to pyparsing 2.2.1?

@The-Compiler
Copy link
Author

@VikneshSK The beginning of that output shows that this is happening in scikit-learn, not in pyparsing and not in setuptools:

...\site-packages\sklearn\utils\__init__.py:4
...\site-packages\sklearn\model_selection_split.py:18

Looking at the git repository I can't find the code referenced in your warnings, so I'm guessing this has been fixed in newer versions.

@jaraco
Copy link
Member

jaraco commented Jun 16, 2020

Locking this issue as Setuptools fails on warnings so can't have this issue. If you've encountered this issue, it's probably in a different project.

@pypa pypa locked as resolved and limited conversation to collaborators Jun 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants