zed icon indicating copy to clipboard operation
zed copied to clipboard

conda `detect_env` does not work on remote ssh

Open Chuong98CC opened this issue 11 months ago • 3 comments

I use zed to dev on a remote server, I have anaconda env and here is my pyrightconfig.json

{
  "venv": "opencv",
  "venvPath": "/Users/chuongnguyen/miniconda3/envs"
}

it works in my local machine but not on the remote server. do i miss anything?

Originally posted by @Chuong98CC in #7646

Chuong98CC avatar Mar 04 '25 20:03 Chuong98CC

actually, I found that setting the project setting will make it partially work

  1. cmd-shift-p --> open command pallete and then search for zed: open project setting. This will create a folder ./zed/setting.json in your project root.
  2. add your python path explicitly
{
    "lsp": {
        "pyright": {
            "settings": {
                "python": {
                    "pythonPath": "/path/to/conda/env/bin/python"
                }
            }
        }
    },
  "terminal": {
    "detect_venv": {
      "on": {
        // Default directories to search for virtual environments, relative
        // to the current working directory. We recommend overriding this
        // in your project's settings, rather than globally.
        "directories": ["/path/to/conda/env"],
        // Can also be `csh`, `fish`, and `nushell`
        "activate_script": "default"
      }
    }
  }
}

but the detect_env still does not work. create new terminal just use the base env

Chuong98CC avatar Mar 05 '25 17:03 Chuong98CC

Just double checking, you are using the same user name on both remote and local dev correct? I.e. /Users/chuongnguyen/miniconda3/envs is a valid path on both the local machine and the remote? (or are they the same computer?)

probably-neb avatar Mar 21 '25 00:03 probably-neb

hi @probably-neb , i am able to use the miniconda using the scripts from this issue https://github.com/zed-industries/zed/discussions/19702. My problem is when I start a new terminal, it does not auto-change into the conda env as in VSCode, but we still have to do in manuanlly, like conda activate env_name thanks.

Chuong98CC avatar Mar 23 '25 20:03 Chuong98CC

with https://github.com/zed-industries/zed/pull/37627 this should hopefully be solved

Veykril avatar Sep 05 '25 11:09 Veykril