Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复初次安装错误问题 #314

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion apps/node/src/modules/utils/conda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,17 @@ class Conda {
* Init conda env
*/
updateCondaInfo () {
const defaultCondaEnv: CondaEnvInfo = {
CONDA_ENV_PATH: '',
CONDA_ENV_NAME: '',
PYTHON_PATH: '',
PIP_PATH: '',
CONDA_ENV_SCRIPTS_PATH: ''
};

// 如果有配置本地自定义的 python 环境,那么就简单设置 PYTHON 和 PIP 就好
this.info = getCondaInfo();
this.env = getCondaEnv(CONDA_ENV_NAME, this.info!);
this.env = getCondaEnv(CONDA_ENV_NAME, this.info!) || defaultCondaEnv;
console.log("env", this.info, this.env);
logger.info("update conda info" + JSON.stringify(this.info) + JSON.stringify(this.env));

Expand Down
6 changes: 3 additions & 3 deletions apps/node/src/routes/api/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ export async function ApiSetupConfig(req: Request, res: Response) {

appConfigManager.set(CONFIG_KEYS.appSetupConfig, setupString);

// if (data.pythonPath) {
// conda.updateCondaInfo();
// }
if (data.pythonPath) {
conda.updateCondaInfo();
}

res.send({
success: true,
Expand Down