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

ImportError: cannot import name 'HAS_F_STRINGS' from 'attr._compat' #31

Open
RvV1979 opened this issue Feb 6, 2024 · 1 comment
Open

Comments

@RvV1979
Copy link

RvV1979 commented Feb 6, 2024

Hi,

When initializing feems, I am getting the following error:

>>> from feems.utils import prepare_graph_inputs
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/feems/__init__.py", line 6, in <module>
    from .sim import setup_graph, simulate_genotypes
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/feems/sim.py", line 8, in <module>
    import msprime
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/msprime/__init__.py", line 35, in <module>
    from msprime.ancestry import (
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/msprime/ancestry.py", line 40, in <module>
    import tskit
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/tskit/__init__.py", line 74, in <module>
    from tskit.provenance import __version__  # NOQA
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/tskit/provenance.py", line 31, in <module>
    import jsonschema
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/jsonschema/__init__.py", line 13, in <module>
    from jsonschema._format import FormatChecker
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/jsonschema/_format.py", line 11, in <module>
    from jsonschema.exceptions import FormatError
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/jsonschema/exceptions.py", line 12, in <module>
    import attr
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/attr/__init__.py", line 10, in <module>
    from . import converters, exceptions, filters, setters, validators
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/attr/converters.py", line 11, in <module>
    from ._make import NOTHING, Factory, pipe
  File "/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/attr/_make.py", line 14, in <module>
    from ._compat import (
ImportError: cannot import name 'HAS_F_STRINGS' from 'attr._compat' (/usr/bin/mambaforge/envs/feems/lib/python3.8/site-packages/attr/_compat.py)

The same error occurs when calling from feems import SpatialGraph, Viz, Objective, query_node_attributes. The strange thing is that feems was running OK on my system before (perhaps a conda update is to blame?). I have tried re-installing the conda environment and feems but this did not help.

Any help or advice would be much appreciated. Thanks

@VivaswatS
Copy link
Collaborator

Hi @RvV1979, sorry for the delayed response! Wondering if you were able to solve this? I haven't seen this error before.
If not (based on a preliminary internet search), I would create a new conda environment and install FEEMS with a more recent version of python (say, 3.10).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants