Kot
Kot

Reputation: 13

activate diffrent conda installation from sshfs

Good Day to you all,

I was wondering if it is possible to use a shared Conda installation on a remote machine. The remote machine is running ubuntu 12 (I have no influence). I use in Windows 10, with the latest updates.

Since it is Ubuntu 12, I cannot run the visual studio code remote ssh. But that's what I kind of want.

So far I installed miniconda3 and set up sshfs for windows and mapped "the folder".

If I use install conda on Linux/Ubuntu, I can modify the .bashrc file and change the conda installation path:

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/[...]/sharedConda/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/[...]/sharedConda/etc/profile.d/conda.sh" ]; then
        . "/[...]/sharedConda/etc/profile.d/conda.sh"
    else
        export PATH="/[...]/sharedConda/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

then it works fine.

Now my questions:

Is this also possible under windows? and how? is there something similar to .bashrc?

Upvotes: 1

Views: 486

Answers (1)

FlyingTeller
FlyingTeller

Reputation: 20599

you will not be able to get this to work. Starting with the python interpreter that is installed in the Ubuntu environment, it is a binary compiled for a linux system. You can mount the folder in windows, but you will not be able to execute the binary nonetheless. The same goes for any module that you have installed that relies on compiled cython or shared libraries. All these things will have been specifically compiled for the ubuntu machine.

You can modify the PYTHONPATH on your windows machine to point to the site-packages of the ubuntu environment, but you will not be able to import any packages that are not pure python.

Instead, you could export the conda environment on the ubuntu machine conda env export > environment.yml and then create it on your windows machine: conda env create -f environment.yml

Upvotes: 1

Related Questions