-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 'TypeAlias' from 'typing' on macOS #322
Comments
I'm also having this issue |
I worked around this by upgrading to python 3.10. diff --git a/environment-mac.yaml b/environment-mac.yaml
index 44cd1ef..6742a1f 100644
--- a/environment-mac.yaml
+++ b/environment-mac.yaml
@@ -1,11 +1,11 @@
-name: ldm
+name: ldm310
channels:
- pytorch-nightly
- conda-forge
dependencies:
- - python==3.9.13
- - pip==22.2.2
-
+ - python=3.10
+ - pip
+
# pytorch-nightly, left unpinned
- pytorch
- torchmetrics
(END) |
TypeAlias is only supported as of python 3.10: https://docs.python.org/3/whatsnew/3.10.html (search in page for 'TypeAlias') So I think this is was caused by the project reverting to python 3.9, which occurred here: #283 A new PR is pending to move back to 3.10: #301 |
This is an error on a different repo. This patch will fix it temporarily (I hope the code I'm pasting works right).
|
This bug was first noticed in this issue. |
@jnordberg your version changes the env name to ldm310, which will probably confuse people. For a minute I thought that was my comment so I edited to fix it, but after saving the fix I realized it was someone else's comment! Sorry for that, I've restored it to the way you had it. |
@magnusviri Ah ok, I was wondering what was going on there 😂 FWIW I'm not seeing any performance regression on python 3.10 on a 16g M1 MacBook Air With 3.9 and the typing_extensions patch: 3.94s/it |
After following the steps in
README-Mac-MPS.md
I get the following error:I tried:
but still get the same error.
This was all working for me before pulling the latest version today, but I removed the ldm anaconda environment to be sure that everything was up to date and ran into problems, so I nuked everything and tried to install from scratch.
The text was updated successfully, but these errors were encountered: