-
Notifications
You must be signed in to change notification settings - Fork 16
Cannot set MYPYPATH #14
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
Thanks for reporting! Could you please clarify what exactly did you try? I could imagine two possible ways (right click in plugin window and then chose "Configure plugin..."):
Please let me know if this works, and I will update the README later when I am back from vacation. |
I will try both of those. I actually already suspected that the first one, at least, should work fine. The only problem is that then it's part of the IDE setup instead of part of the code configuration, which makes getting new developers spun up on an existing repository somewhat harder. What I tried was putting config in the mypy config file at the project root according to the instructions here: http://mypy.readthedocs.io/en/stable/config_file.html However, it seems that either their documentation is wrong, or else this plugin does not start up the mypy daemon with the project root as the working directory, so mypy never sees the config file. I could also set this up as global mypy config, except that different projects use different VENVs, so the correct mypy path varies and isn't properly a system-global variable. I'll report back on your suggestion. |
+1 There is a functionality to add environment variables in a run configuration, but the mypy plugin is working through a run configuration. Any ideas would be helpful. Otherwise the use would have to manually run the export of MYPYPATH each time they use the system. Or they just have to disable checking for packages. |
I'm had the same problem. If you want to follow imports, you need to open the plugin configuration and replace the mypy command to run mypy instead of dmypy - than the default becomes "follow-imports=normal" and the MYPYPATH will be used to find modules. @ilevkivskyi I think you can close this issue since it is a limitation of dmypy and not an issue of your plugin |
Hm, so essentially this is caused by python/mypy#5870. I would keep this open until upstream is fixed. We might need to update the default config when upstream is fixed (currently it is |
Thanks for this plugin - it's nice to have this running constantly inside PyCharm.
There may be a way to do this, but it's not in the README as far as I could tell, so I thought I'd bring this up.
For those of us who want to use types that exist outside our current project, it is nice to be able to
--follow-imports silent
. However this just leads tohandler.py:2: error: Cannot find module named 'botocore.vendored'
or whatever the module is.When running from the command line, I can just add my VENV site-packages dir to the environment variable MYPYPATH and everything works great. However I'm not sure how to usefully define an env var for this plugin. More importantly, it really needs to be something that the plugin can figure out based on some kind of config file, e.g. the mypy.ini config file in the project root. However, setting mypy_path inside that config file does not seem to get picked up by this plugin.
Any thoughts on how to make this work properly?
The text was updated successfully, but these errors were encountered: