-
-
Notifications
You must be signed in to change notification settings - Fork 3k
RuntimeError: Broken installation: can't determine base dir #653
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
Can you give me the directories where different files from mypy live in your setup? Currently mypy is fairly rigid about where different files should live, but I'm happy to update this to support new configurations. In particular, mypy needs to find the stub files. |
Hey @JukkaL , Looks like those are in /usr/lib64. Here's a paste of every file installed: |
Thanks for the info! I'll look into this, hopefully later this week. It should be pretty easy to fix. |
@JukkaL Thanks! Let me know if you need anything else. |
Looks like another Gentoo user found a solution in this bug: https://bugs.gentoo.org/show_bug.cgi?id=551272 I'm going to apply the patch to our ebuild and can submit it as a pull request if it's acceptable. Otherwise, let me know what a better solution would be. |
Apologies for not making progress on this. The fix in the linked issue doesn't work on Python 3.2, which we still support. BTW, the paste link above apparently has expired. |
@JukkaL, Thanks for looking into this again. Here's a new paste link and let me know if I can provide anything else. |
I'm facing this error too. It may be caused by below commit. The change from 2c009ca#diff-564bf8da9227d198a635daea8a663e2bR173 mypy works fine when I reverted this change. |
@icoxfog417: Can you give me more details about your configuration (OS, Python version, are you using virtualenv, where are Python and mypy installed, which package did you use for Python)? |
@JukkaL I'm sorry fot the lack of information.
And also, Windows doesn't have
|
I'm still seeing this issue on Gentoo now that the aforementioned patch no longer applies to master. I can provide more information but I imagine it's the same as before. The current stack trace (slightly different):
|
@alunduil Hmm.. some more information would be useful. Can you tell where the stub files are? For example, run this command and give me the output:
@icoxfog417 Sorry, I dropped the ball on your issue. I'll try to find time to do some testing on Windows later this week or the next week. If possible, it would be helpful if you can tell me where the builtins.pyi file lives in your installation. |
Here's the results of that find command:
Let me know if any other information will help. I'm sure I didn't provide everything you need to troubleshoot the issue well. |
My environment is as below.
There are some points.
And the Then
|
@JukkaL, is there an easy fix for this that I can submit a pull request for? Why are paths hard coded rather than determined relative to a module or searched for in the lib search path? |
The (somewhat) hard-coded paths are because installers put "data" files (in mypy's case that's the stub files) in different locations depending on platform and installer policies, and these locations aren't directly relative to where the code (the mypy package) is installed. I guess if we could arrange to always install the stubs inside the "mypy" module that would make finding them easier (using |
That makes sense. Would you suggest adding the appropriate path for this issue or to look into revamping the stub file search code? I'm guessing the former since it's a simpler patch but that latter seems more robust. |
Yeah, I would just hard-code another path in the existing code (it just
probes various locations until it finds one). It should be a simple PR.
Thanks!
|
Found the culprit. It appears that following the symlinks that the mypy script is behind leads to This base directory wasn't accounted for in the verify function in the git module. I'm testing a patch now and will submit a pull request if it's successful. |
Great news, looking forward to the PR!
|
Gentoo uses a wrapper around pythons to handle their dynamic default python selection on a system with many versions of python installed simultaneously. Due to this mypy's script is a symlink to a file in /usr/lib/python-exec/python3.5. This means that the search path needs to check if python-exec is being used and return the appropriate path (usually '/usr/lib'). This patch works successfully on my Gentoo system. Fixes python#653.
Gentoo uses a wrapper around pythons to handle their dynamic default python selection on a system with many versions of python installed simultaneously. Due to this mypy's script is a symlink to a file in /usr/lib/python-exec/python3.5. This means that the search path needs to check if python-exec is being used and return the appropriate path (usually '/usr/lib'). This patch works successfully on my Gentoo system. Fixes #653.
When installing via portage (I'm working on packaging mypy for portage), I get the following when trying to run mypy:
I'm not sure what directory it's starting with but I can tell it's not finding what it's looking for. Any guidance would be appreciated.
The text was updated successfully, but these errors were encountered: