Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Regression in PYTHONPATH support #993

Closed
chdsbd opened this issue Apr 18, 2019 · 9 comments
Closed

Regression in PYTHONPATH support #993

chdsbd opened this issue Apr 18, 2019 · 9 comments

Comments

@chdsbd
Copy link

chdsbd commented Apr 18, 2019

It seems that it is no longer possible to set PYTHONPATH and have that respected for imports.

Here's a small repo that should reproduce the issue: https://github.com/chdsbd/vscode-pythonpath-reproduction

I think this may be related to #849

@jakebailey
Copy link
Member

I'm a bit confused by this test case; should test_foo have read from core.foo import Animal?

image

@chdsbd
Copy link
Author

chdsbd commented Apr 18, 2019

This is what it looks like for me:
Screen Shot 2019-04-18 at 5 38 11 PM

@jakebailey
Copy link
Member

jakebailey commented Apr 18, 2019

I understand, but there is no such module core.fields. It's in foo.py. I modified the code in my screenshot to import core.foo.

@chdsbd
Copy link
Author

chdsbd commented Apr 18, 2019

whoops, yeah, that's from me trying to cut this down. I'll reopen this when I fix the reproduction.

@chdsbd chdsbd closed this as completed Apr 18, 2019
@jakebailey
Copy link
Member

No problem. I'd also like to know your OS, as we might have different setups.

I also run using the master branch of the extension directly, not the release, which may impact things as well. I made a PR there a few weeks ago which modifies the startup process when it comes to these sorts of paths.

@chdsbd
Copy link
Author

chdsbd commented Apr 18, 2019

I'm running macOS 10.13.6 with Python 3.7, VSCode 1.33.1, and python language server 0.2.59.0

Fixing the typo apparently still leads to an unresolved import issue:

Screen Shot 2019-04-18 at 6 04 38 PM

I've push the fix to the repo I linked above.

@jakebailey
Copy link
Member

With what you have in that repo, it works for me. My OS is Windows, but I'm willing to bet that it's an extension version difference that's doing this and not the OS (but I'll be checking). Would you be willing to try out running the extension at master? See: https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md

You might also be able to test the "development build", though I don't know which revision it's built from.

@chdsbd
Copy link
Author

chdsbd commented Apr 18, 2019

I just tried it with the 2019.5.6925-dev development build and everything seems to work well now.
Thanks for the help.

@jakebailey
Copy link
Member

That's good news; thank you for checking.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants