简体   繁体   English

如何在可移植 Visual Studio 代码中设置可移植 python 路径?

[英]How to set portable python path in portable Visual Studio code?

I am trying to run python file in portable Visual Studio Code.我正在尝试在可移植的 Visual Studio Code 中运行 python 文件。
I added "python.pythonPath":"./../" in launch.json file to set path.我在launch.json文件中添加了"python.pythonPath":"./../"来设置路径。

But it doesn't work.但它不起作用。
I need to set python path in vscode.我需要在 vscode 中设置 python 路径。 I want to execute on portable python interpreter.我想在便携式 python 解释器上执行。 What can I do for solving this problem?我能做些什么来解决这个问题?

When you entered "../../", what did you think that was relative to?当您输入“../../”时,您认为这与什么有关? python.pythonPath should have the absolute path to your Python interpreter. python.pythonPath应该具有 Python 解释器的绝对路径。 It should start from C: and it should end with python.exe .它应该从C:开始,它应该以python.exe结束。 The Python: Select Interpreter command (from Ctrl-Shift-P) can help you choose this. Python: Select Interpreter命令(来自 Ctrl-Shift-P)可以帮助您选择此项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM