-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Editable install fails with ImportError (unknown location) on Windows 10 outside of venv #19089
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
Mhm, that's interesting, because I have no issues running editable installs (and that's in fact how I triage all issues -
And same with plain
I'm running a flavour of Ubuntu 24.04, with python installed with uv (3.13, first snippet) and system python (3.12.3 at /usr/bin/python, second snippet). Basic info:
|
Curious! Maybe my computer is cursed. I'll get more details on here in a while, but the most significant difference I detect is that I'm not using a venv. So maybe that lets mypy get confused about where things are. Other edited-in details: Python 3.12.8 |
One potential idea is that I believe the editable install mechanism may differ between platforms that support symlinks and those that don't. |
On Windows cmd, which I'm using, the command is Same if I cd up a directory, and then Note to self: if I end up touching the project for this, edit the Interesting theory about the symlink! I do have symlinks turned on in Windows, btw. (If this does become relevant, one can see https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/ or https://portal.perforce.com/s/article/3472 for more information about that which I've forgotten in the years since I enabled symlinks for myself.) on WSL, which I also have, testing on WSL1, meticulously following the instructions in CONTRIBUTING.md, it works. Trying in windows cmd again, meticulously following the instructions in CONTRIBUTING.md, it works. However, just running It also works outside of a venv on wsl, although of course I have to use --break-system-packages Trying When I say work/doesn't work here, I mean them all in the same way, from the OP. Here is the full traceback every time:
|
I can't reproduce this in
|
@A5rocks what if you don't do it from inside a venv? |
Works fine without venv in docker Unfortunately I won't be able to assist with debugging this problem further, sorry - too lazy to configure virtualbox and fight with windows licenses... |
Sure thing! I don't recall but symlinks may not be used even if enabled on Windows. @wyattscarpenter just confirming, you installed Python from official python.org installers? |
I also could not reproduce this FWIW. |
Yep, that's where I got my Python from. |
Sorry I forgot to do this, but I still can't reproduce this:
|
Dang, alright. I'm back to the hypothesis that my computer is cursed, I guess. |
On a hunch, I tried downloading mypy to a new directory that doesn't have any spaces or punctuation in it. I got
Also, if I try installing master instead of v1.15.0, it silently exits. Whether I do an editable or regular install. Trying to
Unless anybody else has these problems, I'm just going to assume something on my machine has gotten misconfigured over time, possibly the PYTHONPATH or similar, and close this issue. |
Can you see if you have a |
I doubt it's worth trying to troubleshoot this, but thanks for the effort 😄 |
Uh oh!
There was an error while loading. Please reload this page.
Bug Report
python -m pip install -e .
, which is recommended in CONTRIBUTING.md, does not work. The installation goes fine, but upon an attempted run, the installed mypy prints an error ending with:Workaround
A non-editable install,
python -m pip install .
, works fine.To Reproduce
python -m pip install -e . && mypy
Expected Behavior
mypy small help message, ie
usage: mypy [-h] [-v] [-V] [more options; see below]
etcActual Behavior
Crash with traceback, ending in
Your Environment
Additional information
Previously, I'd always assumed my computer was just cursed in some way, and this was some idiosyncratic problem. But my google-fu was strong today and I discovered https://stackoverflow.com/questions/19602582/pip-install-editable-links-to-wrong-path, suggesting that there might be something wrong with setup.py.
Proposed test
It might be worth making a new basic test that tries installing with -e and performing some basic check.
The text was updated successfully, but these errors were encountered: