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

Hug*_*inn 5 python intellisense visual-studio-code pylance

有一个问题: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
> /bin/python2 ~/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/interpreterInfo.py
> /bin/python3 ~/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/interpreterInfo.py
> /bin/python3.10 ~/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/interpreterInfo.py
> /usr/bin/python2 ~/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/interpreterInfo.py
> /usr/bin/python3 ~/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/interpreterInfo.py
> ". /home/db/jupyter_env/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /home/db/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/printEnvVariables.py"
Starting Jedi language server.
> ~/jupyter_env/bin/python -m pylint --msg-template='{line},{column},{category},{symbol}:{msg} --reports=n --output-format=text ~/data/qualityControl/core/data_verification/dataQualityControl.py
cwd: ~/
##########Linting Output - pylint##########
************* Module core.data_verification.dataQualityControl
18,53,error,syntax-error:non-default argument follows default argument (<unknown>, line 18)
Run Code Online (Sandbox Code Playgroud)

Hug*_*inn 3

基本上,问题是,如果在 VSCode 中选择了一个大工作区,它会尝试对其全部进行索引,并且在完成之前,突出显示不会打开。就我而言,我安装了多个 AWS 存储桶,并且由于数据量约为 100TB,因此文件索引根本无法完成。但是,如果我选择特定的项目文件夹,问题就会消失。所以遇到这样的问题,尽量指定工作目录。祝你好运!