Я хочу активировать активацию среды conda перед запуском моего файла python с помощью команды os.system
, но, к сожалению, я не могу активировать среду conda.
Ниже приводится команда, которую я пытаюсь реализовать:
import os
command="python run.py"
foldername="/home/ritish/DeepSpeech/DeepSpeech-master/20140421/test_folder/Test_on_Voice/core_files/raw_file"
files=list(os.listdir(foldername))
if files:
os.system("conda activate deepspeech3")
os.system(command)
else:
print("No Files to Run")
Я получаю следующую ошибку:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
* Serving Flask app "core_files" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 119-628-161