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

Created on 27 Jun 2018  路  18Comments  路  Source: pypa/setuptools

In Python 3.7, importing ABCs directly from the collections module shows a
warning (and in Python 3.8 it will stop working) - see
https://github.com/python/cpython/commit/c66f9f8d3909f588c251957d499599a1680e2320

.../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...

bug

Most helpful comment

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

All 18 comments

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

PyParsing has moved to GitHub. Here's a PR for it: https://github.com/pyparsing/pyparsing/pull/16.

PyParsing has been updated to 2.2.1 in Setuptools in https://github.com/pypa/setuptools/commit/d4b5eb62d4a848c5cf6e2a0c3c5f39151b31897d.

This issue can be closed.

Released in 40.4.1.

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.

https://github.com/pypa/setuptools/blob/5ba6a4246793d5ad3c9ec105792c1d16aa13a205/pkg_resources/_vendor/pyparsing.py#L63

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.

:/

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.

I think this was fixed in 2862b90422c63afc8864952878594e4194c517d9.

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

@cepbrian What does "2.10" refer to there?

2.10 is the version of jinja2 I'm using.

```

import jinja2

print (jinja2.__version__)
2.10

```

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

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

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

Thanks

I hope this issue has started again!

Error: C:ProgramDataAnaconda3libsite-packagessklearnutils__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:ProgramDataAnaconda3libsite-packagessklearnmodel_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?

@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.

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.

Was this page helpful?
0 / 5 - 0 ratings