0

I was using some python-based package called pyscenic. I installed it in a conda environment called scenic. whereis pyscenic results in /home/user/.conda/envs/scenic/bin/pyscenic

When I use conda activate scenic then pysenic, it works properly.

I built a jupyter notebook and added scenic as one of the kernel, then I opened a notebook under this kernel, so supposedly I'm now in working under this conda env. However, when I do !pysenic, it tells me /bin/bash: pyscenic: command not found, tried adding !export PATH=/home/joyzheng/.conda/envs/scenic/bin/pyscenic prior to the command doesn't work either. I guess the problem lies with location of the files and directory but I'm not sure how it worked exactly.

The question was marked duplicated to another question asking about linking conda env to jupyter notebook... I've already linked it, but failed to use packages installed in that conda env.

The problem was resolved via specifying the path to that program. Seems like even if I'm already opening the notebook under corresponding kernel, when using !command it still goes back to find command from the base environment. I have to specify !/home/user/.conda/envs/scenic/bin/pysenic rather than !pysenic to make it work.

Joy Zheng
  • 49
  • 6
  • Running `export PATH` in a subprocess only changes it in that subprocess, which then exits immediately (which is just as good, because the value you tried to use for the `PATH` is badly broken - you need to add a directory to the previous value, not replace it entirely, or basic commands like `cat` and `ls` and `python` will no longer be found). – tripleee Mar 06 '23 at 06:31

0 Answers0