小编Hug*_*inn的帖子

VS 代码。Pylance 无法通过 SSH 连接工作

有一个问题:Pylance(IntelliSense)无法在远程服务器上工作。同时它在本地工作。Pylance 本身安装在本地和服务器上。导入只是白色的,当我将鼠标悬停在它上面时,只会弹出“正在加载...”。“转到定义”也不起作用。

有这样的性质:

  • 蟒蛇:3.10.2;
  • 皮兰斯:2022年1月3日;
  • Python扩展:v2021.12.1559732655;
  • 远程 - SSH:v0.70.0
  • VS代码:1.63.2;
  • 本地操作系统:Windows 10 专业版;
  • 远程操作系统:Ubuntu 20.04.3 LTS
  • Virtualenv 作为环境;

我已经尝试过很多选择:

  • 安装了其他版本的 Pylance;
  • Python 扩展本身的旧版本;
  • 将Python从3.8.10更新到最新版本3.10.2;
  • 将语言服务器更改为 Jedi 并恢复为 Pylance;
  • 重新安装扩展、VSCode;
  • 使用新的 python 重新创建环境。
  • 添加到远程settings.json此设置: "python.insidersChannel": "daily", "python.languageServer": "Pylance"

“Python:显示输出”给出以下输出:

Experiment 'pythonaacf' is active
Experiment 'pythonTensorboardExperiment' is active
Experiment 'pythonSurveyNotification' is active
Experiment 'PythonPyTorchProfiler' is active
Experiment 'pythonDeprecatePythonPath' is active
> conda info --json
> ~/jupyter_env/bin/python ~/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/interpreterInfo.py
> ~/.anaconda_backup/bin/conda info --json
Python interpreter path: ./jupyter_env/bin/python
> conda --version
> /bin/python ~/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/interpreterInfo.py …
Run Code Online (Sandbox Code Playgroud)

python intellisense visual-studio-code pylance

5
推荐指数
1
解决办法
3456
查看次数