conda管理多版本python,shell如何使用多版本python
現在由於需要使用不同版本的python,因此對應的shell腳本中也需要進行對應的變更
運行如下代碼即可:
#!/bin/bash
source /opt/module/miniconda3/etc/profile.d/conda.sh
conda activate pythonThirteen
python /opt/module/python_shell/huaweicloud/service.py
或者是进入env中,发现有两个python环境,别名分别是superset、pythonThirteen
因此可以指定路径env路径去执行相关python文件
#!/bin/bash
/opt/module/miniconda3/envs/pythonThirteen/lib/python3.12 /opt/module/python_shell/result_myoa/server.py