-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
typeshed not being found on windows user install #3988
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
It would seem that mypy's search for typeshed needs to be augmented with a case for this type of configuration. Mypy itself is at How did your Python install get in that location? I don't think that's where the Windows installers downloaded from python.org put it (but I might be wrong). |
I can debug this.
For me the default 3.x install directory for the newer installers (3.5+) point to |
Python 3.5+ installs to `%APPDATA%\python\PythonXY`. Mypy, when installed as user, installs typeshed to `%APPDATA%\python\lib\mypy`. This fixes the issues with resolving the path to typeshed. Additionally, more debug information is added to the error message to assist in debugging issues like this in the future. Fixes #3988
sorry for a slightly-too-late response, the fix doesn't seem to work for me :( https://gist.github.com/Summertime/403ce90d067253669796326212becce0 probably-overkill install logs are here for the exact paths of everything (installing from the latest merge) I can give a shot at trying to work out the issue in a couple days, however the problem might be obvious from the install logs already, I'm not too sure. |
Hm okay. Based on the output of the log it seems that you are using a custom compiled Python. Is that true? Sorry that fix didn't work for you. |
no custom compiling! I reinstalled python just to make sure, clicked the main 3.x.x download link on python.org, did the following, then ran |
Could you tell me what |
I wonder if (at least on Windows) the search code should apply
os.path.normpath() before comparing?
…On Sun, Sep 24, 2017 at 3:13 PM, Ethan Smith ***@***.***> wrote:
Could you tell me what where mypy gives you now that you re-installed
Python? Thanks!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3988 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACwrMkCtUmPLkNqTdu6tANJwr6ik7HrBks5sltP0gaJpZM4PheqA>
.
--
--Guido van Rossum (python.org/~guido)
|
Could you point out the comparison that you are thinking of? The part of the code in question is independent of the OS path separator to my knowledge. I'm thinking of here in particular Line 231 in 6c409b4
|
I wasn't thinking of |
Confusingly, |
I'm working on the hypothesis that I have no idea what installer was used, so I don't want to exclude this hypothesis yet -- it seems to be using capitalization in earlier segments of the path (at least |
I did make sure to wipe all site-package/script directories before reinstalling too, so not an artifact of the previous install
As reported by powershell/windows (and as a result, probably the "official" capitalization that would show up:
I'm working on seeing if this reproduces in a fresh windows 10 VM using only |
Aha, I see an issue. In the screenshots of your installer, you are using Python 3.6 32 bits. It is being installed in However, I agree that the check for prefixes with |
Hm, that is concerning. Could you describe how it is broken? |
...or make this check dependent on |
I see this when I install from git master:
|
FWIW, removing the line I mentioned fixes the problem. But I have no idea why. |
it goes into I did say I wiped the folder! And it reproduces in a VM too!
However I will note, running the module directly works:
(but for some reason my main install doesn't mirror that, dunno!) (I guess I'll consider my main install damaged for now since it repros differently) |
It looks like installation on Mac is also broken now. I see:
|
Should we just roll back whatever broke things recently?
On Sep 25, 2017 6:58 AM, "Ivan Levkivskyi" <notifications@github.com> wrote:
It looks like installation on Mac is also broken now. I see:
tst22.py: error: Name '__builtins__' is not defined
tst22.py:1: error: No library stub file for standard library module 'typing'
tst22.py:1: note: (Stub files are from https://github.com/python/typeshed)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3988 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACwrMpNq95PXa1706JJE3P_zHYh7zUUKks5sl7E7gaJpZM4PheqA>
.
|
I made a PR which should fix everything in #4005. |
On Windows, the usual install paths are `sys.prefix/Lib/mypy` for a global install. For user installs, the path is `site.getuserbase()/lib/mypy`. We also fall back to the old method of installation due to the data dir being put in the package directory on an egg install. This restores the usual data directory resolution on other platforms. Correctly fixes #3988, and keeps other platforms working.
The data directory (after searching for
typeshed
) appears to be%AppData%\Python\lib\mypy
full path:
C:\Users\[redacted!]\AppData\Roaming\Python\lib\mypy
using this directory leads to more expected results
The text was updated successfully, but these errors were encountered: