I am trying to develop Python code on a remote cluster. If I were doing this directly on the cluster, I would have to load an Anaconda Lmod module before I could access any of my conda environments:
module load Anaconda3/2020.11
As a quality of life improvement, I would like to use VSCode with the Remote-SSH extension to work on the cluster. However, I cannot seem to load the module that I need in order to select my conda environment as the Python interpreter. Running the module load XX command in the VSCode terminal does not seem to apply the settings when I run a Python script.
Is there a way for me to load the module using VSCode after I connect to the remote machine so that I can access my conda environment and run my code?
I had the same problem and solved it by loading the lmod modules when the vscode server starts.
The verified answer in this issue brought me towards the solution.
You can just put the module load Anaconda3/2020.11 command in your .profile file in your home directory. If none exists on the cluster you can just create one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With