在VS Code中设置本地项目的Python路径而不使用settings.json文件 [英] Setting the Python path for local project in VS Code without using the settings.json file

查看:1273
本文介绍了在VS Code中设置本地项目的Python路径而不使用settings.json文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此答案说,保持Visual Studio Code项目的<$ c是合理的项目git存储库中的$ c> settings.json 文件,可在不同的开发环境中实施代码标准。缺点是,当我在屏幕底部选择Python解释器路径时(这样,lint可以找到已安装的软件包),以下条目将添加到 settings.json 文件:

This answer from a Visual Studio Code developer says that it is reasonable to keep a Visual Studio Code project's settings.json file in a project's git repository to enforce code standards across different development environments. One down-side though is that when I select the Python interpreter path at the bottom of the screen (so the linter can find the installed packages), the following entry gets added to the settings.json file:

"python.pythonPath": "/path/to/conda/envs/my-env-name/bin/python",

此路径是机器本地的,并假定使用了conda 。我必须避免将此设置添加到我提交到git存储库的 settings.json 中,这很烦人。

This path is local to the machine and assumes that conda is being used. I have to avoid adding this setting to the settings.json that I commit to the git repository, which is annoying.

是否可以在不将设置写入 settings.json 文件的情况下为项目在本地设置Python路径?

Is there a way to set the Python path locally for a project without writing a setting into the settings.json file?

推荐答案

当前不直接支持,但我们有功能请求,如果您希望优先处理该请求,则可以对其进行投票。

It currently isn't directly supported, but we have a feature request that you can upvote if you would like to see it prioritized.

这篇关于在VS Code中设置本地项目的Python路径而不使用settings.json文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆