Open nils-werner opened 4 years ago
I started looking into how venv16 and venv20 differ and I noticed that Virtualenv 20 creates python as a symlink to the system-wide python, and Virtualenv 16 doesn't.
ls -alh venv16/bin/python
# -rwxr-xr-x 1 nils nils 14K 16. Apr 10:13 venv16/bin/python*
ls -alh venv20/bin/python
# lrwxrwxrwx 1 nils nils 18 16. Apr 10:13 venv20/bin/python -> /usr/bin/python3.8*
If I create the virtualenv using the --copies
flag, no such symlink is created but the executable is instead copied:
newvenv/bin/virtualenv --copies venv20copies
venv20copies/bin/pip install jupyter
source venv20copies/bin/activate
atom .
And Kernels are successfully detected.
So it seems the Hydrogen Kernel detector is unable to deal with symlinks?
As a workaround, you may create a virtualenv config file (see the last line of virtualenv --help
for the location of that file) with the contents
[virtualenv]
copies = True
Prerequisites
Description
When creating an environment using virtualenv >= 20, Hydrogen is unable to automatically pick up Kernels available in the environment. This used to work just fine with virtualenv < 20.
Steps to Reproduce
To reproduce this we need four environments:
oldvenv
, created by system-virtualenv, with virtualenv<20 insidenewvenv
, created by system-virtualenv, with virtualenv>=20 insidevenv16
, created by virtualenv<20 from environment 1, with Jupyter insidevenv20
, created by virtualenv>=20 from environment 2, with Jupyter insideVersions
OS version: Arch Linux latest
Hydrogen version:
2.14.1
Plugins
Have you installed and activated any of the Hydrogen plugins below ?
Logs
There is only
findCodeBlock
andCellManager
content in the logs, they are unrelated to Kernel detection.Expected behavior
I expect Hydrogen to pick up Kernels in environments created by both virtualenv<20 and virtualenv>=20.