I got error when i try to import pennylane

I tried to fix error, but i know know why such error happens

File ~/anaconda3/lib/python3.9/site-packages/pennylane/__init__.py:125, in 
    122 import pennylane.qinfo  # pylint:disable=wrong-import-order
    123 from pennylane.interfaces import execute  # pylint:disable=wrong-import-order
--> 125 import pennylane.dat
    144     See: https://peps.python.org/pep-0681/
    145     """
    148 Self = TypeVar("Self", bound="Dataset")
TypeError: dataclass_transform() got an unexpected keyword argument 'field_specifiers'

I already tried to uninstall pennylane and install again, or sudo apt-get update, pip install qiskit --upgrade, pip install pennylane --upgrade, etc.
Also conda install -c conda-forge pennylane does not work (infinite loading for Solving environment)

Nothing works, i need help

Hey @maar_hybrid!

Interesting… none of us here are able to replicate that — we can all install a fresh version of PennyLane on Python 3.9 without issues. It might be that you’re using an old version of typing_extensions :thinking:. PennyLane requires typing_extensions~=4.5.0, and I think there was only a 4.5.0 release, so it should be that version specifically.

If none of this works, I recommend creating a fresh virtual environment and installing PennyLane there :slight_smile:. Let me know if any of this helps!

I dont know why but i solved problem by update lots of things. Thank you

1 Like

I’m glad you solved the problem @maar_hybrid !

1 Like