Skip to content

Python 3.9 environments break when installing due to dataclasses dependency #6

Description

@jishida0620

Hi. When I tried to install chemoton following the guidance on the README, pip completely broke with an error that makes it impossible to use pip anymore.

Environment

  • Python 3.9.16
  • Ubuntu Linux
  • pip 22.0.4

Steps to reproduce

python3.9 -m venv chemoton_env
source chemoton_env/bin/activate
git clone https://github.com/qcscine/chemoton.git
cd chemoton
pip install -r requirements-dev.txt

Error

After installation, any pip command fails with:

Traceback (most recent call last):
  File "/home/me/.py39/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
  ...
  File "/home/me/.py39/lib/python3.9/site-packages/dataclasses.py", line 550, in _is_classvar
    return type(a_type) is typing._ClassVar
AttributeError: module 'typing' has no attribute '_ClassVar'

Investigation

I found that the dependency chain chemoton → scine_art → svgutils → dataclasses causes this issue. The dataclasses package (0.6) is a Python 3.6 backport that shouldn't be installed on Python 3.7+, but somehow it gets installed and breaks the Python environment.

Questions

Does chemoton officially support Python 3.9? I couldn't find specific Python version requirements in the documentation.
Is there a known workaround for this installation issue?
Would it be possible to add constraints to prevent the dataclasses package from being installed on Python 3.7+?

I'm stuck and can't proceed with using chemoton. Any help would be greatly appreciated!
Thanks for developing this interesting project - I'm looking forward to exploring chemical reaction networks once I can get past this installation issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions