-
Notifications
You must be signed in to change notification settings - Fork 295
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
ipython kernel doesn't recognize user def modules of .env #3162
Comments
@YoniChechik. Thanks for the report on this. You're correct that interactive isn't picking this up. We'll look at fixing this up, either via marking or respecting the .env setting. |
I also noticed that the interactive is launched always inside the directory of the first project of a workspace. Is there a mini document on how to hack iPython's extension?
|
this probably relates to this #3141. |
This is kind of related to: |
Having the same issue. Does the P0 label mean a fix will be part of the next release? |
Also, I was wondering if this was a design decision or due to some limitations? (Copied from here.)
Wouldn't it be best to have |
This bug is currently in the 'Nice to have bug fixes for feb 2020', so it's a maybe for fixing now. More likely for the March release.
I may be wrong, but I believe the .env file is supported by the python extension, but not be VS code itself. VS code is responsible for the integrated terminal, so the integrated terminal doesn't support .env files. |
This isn't working for me. I added the following to my .env:
But this has no effect on the sys.path. |
Caused by #2254. Fixing that will fix this. |
Environment data
VS Code version: 1.37.1
Extension version (available under the Extensions sidebar): 2019.8.30787
OS and version: windows 10
Python version (& distribution if applicable, e.g. Anaconda): python 3.7.1
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
Relevant/affected Python packages and their versions: -
Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info microsoft/vscode-python#3977): -
Expected behavior
with .env file that points to some subdir that is the package, both regular run and interactive run of some script should recognize the modules.
Actual behavior
ipython can't recognize non workspace PYTHONPATH/ sys.path.append("..")
Steps to reproduce:
in bar.py call "import foo.foo as foo" when running interactively.
one can also try to sys.path.append("..") but this also doesnt work in this case...
This action works in Binder and in pycharm (using "mark as package dir" + "mark as source dir" of src).
probably the most convenient solution is to implement "mark as package dir" + "mark as source dir" like pycharm which will work for regular and ipython runs.
a more un-IDE solution is just to enable .env to work with ipython.
The text was updated successfully, but these errors were encountered: