Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1797982 - python-theano fails to build with Python 3.9: mixes OrderedDict with abc classes
Summary: python-theano fails to build with Python 3.9: mixes OrderedDict with abc classes
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-theano
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jerry James
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F33FTBFS PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-02-04 10:44 UTC by Miro Hrončok
Modified: 2020-06-11 11:48 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-11 11:48:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github Theano Theano pull 6741 0 None closed Various Python 3.9 related import changes 2020-05-25 18:04:21 UTC

Description Miro Hrončok 2020-02-04 10:44:31 UTC
python-theano fails to build with Python 3.9.0a3.

Running Sphinx v2.2.2
Configuration error:
There is a programmable error in your configuration file:
Traceback (most recent call last):
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/compat/__init__.py", line 10, in <module>
    from collections.abc import (OrderedDict, MutableMapping as DictMixin,
ImportError: cannot import name 'OrderedDict' from 'collections.abc' (/usr/lib64/python3.9/collections/abc.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/sphinx/config.py", line 361, in eval_config_file
    execfile_(filename, namespace)
  File "/usr/lib/python3.9/site-packages/sphinx/util/pycompat.py", line 81, in execfile_
    exec(code, _globals)
  File "/builddir/build/BUILD/Theano-rel-1.0.4/doc/conf.py", line 25, in <module>
    import theano
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/__init__.py", line 88, in <module>
    from theano.configdefaults import config
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/configdefaults.py", line 17, in <module>
    from theano.configparser import (AddConfigVar, BoolParam, ConfigParam, EnumStr,
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/configparser.py", line 16, in <module>
    from theano.compat import configparser as ConfigParser
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/compat/__init__.py", line 16, in <module>
    from collections import (OrderedDict, MutableMapping as DictMixin,
ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/lib64/python3.9/collections/__init__.py)


This is caused by trying to import OrderedDict and MutableMapping from the same namespace.

I've tried to explain this upstream https://github.com/Theano/Theano/pull/6664#issuecomment-581845517




For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01219951-python-theano/

For all our attempts to build python-theano with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/python-theano/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2020-02-04 13:55:20 UTC
Upstream fix: https://github.com/Theano/Theano/pull/6741

Comment 2 Jerry James 2020-02-04 18:49:03 UTC
I have added this patch.  I also attempted a Rawhide build, but that failed when the builder ran out of memory. :-(  I'll attempt it again, but hopefully you can proceed with your python 3.9 work now.

Comment 3 Miro Hrončok 2020-02-04 19:56:04 UTC
Unfortunately, there is one more:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/sphinx/config.py", line 361, in eval_config_file
    execfile_(filename, namespace)
  File "/usr/lib/python3.9/site-packages/sphinx/util/pycompat.py", line 81, in execfile_
    exec(code, _globals)
  File "/builddir/build/BUILD/Theano-rel-1.0.4/doc/conf.py", line 25, in <module>
    import theano
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/__init__.py", line 124, in <module>
    from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/scan_module/__init__.py", line 41, in <module>
    from theano.scan_module import scan_opt
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/scan_module/scan_opt.py", line 60, in <module>
    from theano import tensor, scalar
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/tensor/__init__.py", line 8, in <module>
    from theano.tensor.basic import *
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/tensor/basic.py", line 20, in <module>
    from theano.scalar import int32 as int32_t
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/scalar/__init__.py", line 3, in <module>
    from .basic import *
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/scalar/basic.py", line 1660, in <module>
    maximum = Maximum(upcast_out, name='maximum')
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/scalar/basic.py", line 1031, in __init__
    if not isinstance(output_types_preference, collections.Callable):
AttributeError: module 'collections' has no attribute 'Callable'

Comment 4 Miro Hrončok 2020-02-04 20:45:22 UTC
And even then:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/sphinx/config.py", line 361, in eval_config_file
    execfile_(filename, namespace)
  File "/usr/lib/python3.9/site-packages/sphinx/util/pycompat.py", line 81, in execfile_
    exec(code, _globals)
  File "/builddir/build/BUILD/Theano-rel-1.0.4/doc/conf.py", line 25, in <module>
    import theano
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/__init__.py", line 124, in <module>
    from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/scan_module/__init__.py", line 41, in <module>
    from theano.scan_module import scan_opt
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/scan_module/scan_opt.py", line 60, in <module>
    from theano import tensor, scalar
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/tensor/__init__.py", line 38, in <module>
    from theano.tensor import nnet  # used for softmax, sigmoid, etc.
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/tensor/nnet/__init__.py", line 23, in <module>
    from . import opt
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/tensor/nnet/opt.py", line 11, in <module>
    from theano.tensor.nnet.corr import (
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/tensor/nnet/corr.py", line 13, in <module>
    from theano.tensor.nnet.abstract_conv import get_conv_output_shape
  File "/builddir/build/BUILD/Theano-rel-1.0.4/theano/tensor/nnet/abstract_conv.py", line 9, in <module>
    from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/usr/lib64/python3.9/fractions.py)

Comment 5 Miro Hrončok 2020-02-04 20:50:27 UTC
Ie updated https://github.com/Theano/Theano/pull/6741 - it now passes the docs build. Running %check now...

Comment 6 Miro Hrončok 2020-02-04 23:31:21 UTC
It builds with the PR.

Comment 7 Jerry James 2020-02-05 02:22:46 UTC
I pushed the changes and launched another Rawhide build.  With luck it won't be assigned to an ARM builder...

Comment 8 Ben Cotton 2020-02-11 17:19:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 9 Miro Hrončok 2020-05-25 13:02:41 UTC
This comment is mass posted to all bugs blocking the Python 3.9 tracker, sorry if it is not 100 % relevant. When in doubt, please ask.


The Python 3.9 rebuild is in progress in a Koji side tag.

If you fix this bug, please don't rebuild the package in regular rawhide, but do it in the side tag with:

    $ fedpkg build --target=f33-python

The rebuild is progressing slowly and it is possible this package won't have all the required build dependencies yet. If that's the case, please just leave the fix committed and pushed and we will eventually rebuild it for you.

You are not asked to go and try rebuild all the missing dependencies yourself. If you know there is a bootstrap loop in the dependencies, let me know and we can untangle it together.

If you want to test your fix or reproduce the failure, you can still use the Copr repo mentioned in the initial comment of this bug: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Comment 10 Lumír Balhar 2020-05-26 13:39:33 UTC
Theano is currently blocked by flake8/pyflakes. Would you accept a patch to drop the build dependency on flake8? I think that linting is not that useful in RPM build and a lot of flake errors are already ignored by an existing patch.

Comment 11 Jerry James 2020-05-26 21:26:42 UTC
Yes, absolutely.  I had meant to do that already, but am currently buried under big piles of $DAYJOB work.

Comment 12 Miro Hrončok 2020-05-29 07:12:21 UTC
Python 3.9 update: The f33-python side tag is currently being merged.

New builds in f33-python are no longer possible, but python3 is not yet updated to Python 3.9 in rawhide. You can check when Python is Python 3.9 with:

    $ koji wait-repo f33-build --build python3.9-3.9.0~b1-3.fc3

And build the packages normally after that.

Comment 13 Miro Hrončok 2020-06-11 11:48:58 UTC
This is a bulk close of Python 3.9 bugzillas of packages that successfully built.
If this remained open for a reason, I am sorry and feel free to reopen.


Note You need to log in before you can comment on or make changes to this bug.