-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
python 3.9.2 windows argparse no module _typeshed #5201
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
Comments
OK nevermind, visual studio code troll me |
So, what was the solution? |
none, I copy paste a code and somehow scroll and never saw the problem was on the first line. (on a 3 line file ??? as I said visual studio troll me I don't know how, it add the import line I think) |
Yeah, happened exactly the same to me... |
Yeah same here people |
Can we get more details about how this is happening? What editor and version? What is the name of the file you save the code into? Which button do you click in the editor to run it? |
I had the same error and thought i was going mad for a second. For those asking for more details visual studio code autocomplete had added the following at top of file and then scrolled down causing line 1 to be hidden. As @Stargateur indicates this even happens in very short files.
|
Why this happened? Hey, guys! This happens because inside the code there's some attribute being called when creating basic functions like
Notice that 'AnyPath' and 'OpenTextMode' aren't variables you created in your code, they are already built in to python and your code is importing them and, whenever we call something from outside our file.py, we must declare it by using
What VSCode did was complete the code with those necessary commands for this attributes to work And what those attributes do?
|
from typing import TYPE_CHECKING if TYPE_CHECKING: Use this work for me |
python 3.9 Мне помог импорт: |
Same here, it automatically added the "from _typeshed import" statement at line 1. |
MCVE:
Error:
At this point I don't know what to do.
#5021 doesn't seem related
The text was updated successfully, but these errors were encountered: