Jupyter notebook doesn't respect python.pythonPath
See original GitHub issueEnvironment data
- VS Code version: 1.44.0-insider, 073a24de05773f2261f89172987002dc0ae2f1cd, x64
- Extension version (available under the Extensions sidebar): 2020.3.69010
- OS and version: Linux 5.4.27, NixOS, x86_64 GNU/Linux
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.6, Nix
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): direnv
- Relevant/affected Python packages and their versions: …
- Relevant/affected Python-related VS Code extensions and their versions: …
- Jedi or Language Server? (i.e. what is
"python.jediEnabled"
set to; more info #3977): Language Server - Value of the
python.languageServer
setting: Microsoft
Expected behaviour
Defaults to python.pythonPath
Actual behaviour
Not sure, it either uses the system configuration of python.pythonPath
or defaults to the whatever the python
in $PATH
is.
Steps to reproduce:
settings.json
{
"python.pythonPath": ".direnv/python/bin/python"
}
➜ l .direnv
total 1.0K
drwxr-xr-x 2 0 Mar 24 13:23 .
drwxr-xr-x 11 0 Mar 24 13:15 ..
lrwxrwxrwx 1 61 Mar 24 13:23 python -> /nix/store/2qkmajsj18pl8cz5hjjyslg10mblfmbd-python3-3.7.6-env
lrwxrwxrwx 1 61 Mar 24 13:23 python-3.7.6 -> /nix/store/2qkmajsj18pl8cz5hjjyslg10mblfmbd-python3-3.7.6-env
➜ readlink -f .direnv/python/bin/python
/nix/store/2qkmajsj18pl8cz5hjjyslg10mblfmbd-python3-3.7.6-env/bin/python
Nix and direnv files can be provided if needed.
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
...
> /nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/bin/python3 -c "import notebook"
> /nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/bin/python3 -c "import notebook"
> /nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/bin/python3 -c "import jupyter"
> /nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/bin/python3 -c "import jupyter"
> /nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/bin/python3 -c "import notebook"
> /nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/bin/python3 -c "import notebook"
> /nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/bin/python3 -c "import jupyter"
> /nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/bin/python3 -c "import jupyter"
> /nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/bin/python3 -c "import notebook"
> /nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/bin/python3 -c "import notebook"
...
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (2 by maintainers)
Top Results From Across the Web
How to make Jupyter notebook use PYTHONPATH in system ...
In pure Python, it prepends my system environment variable PYTHONPATH to sys.path but Jupyter notebook doesn't, so I can't import my own module....
Read more >How can I pass environment variabel PYTHONPATH to ...
I have implemented or better called jupyter notebook in a terminal session, no problem at all. The object is to share import (environment)...
Read more >jupyterlab not honouring PYTHONPATH env var
Dear all, version 0.32.1 of JupyterLab does not seem to honour the `PYTHONPATH` env var if it is set upon launch of the...
Read more >Jupyter notebook not installing - Python - Codecademy Forums
Your python command is already on your PATH in this case so you can use it directly. It (python) has its own path...
Read more >Jupyter Documentation - Read the Docs
This information explains how to install the Jupyter Notebook and the IPython kernel. Prerequisite: Python. While Jupyter runs code in many programming ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@GuillaumeDesforges If its ok with you, i’m going to create an issue in another repo to discuss the issue with you further. I believe what you are experiencing is slightly different.
I’ve filed the issue here https://github.com/microsoft/vscode-jupyter/issues/5335
@eadwu, sorry this is taking so long. We’ll take a look as soon as possible.