I want to get into a conda environment called ‘tensor’ and execute a package call slither-analysis that I had installed in that environment and can only be execute from terminal.
I tried some things but nothing worked out:
import subprocess
subprocess.run('conda activate tensor | slither . --checklist > analysis.md', capture_output=True, text=True, shell=True)
The ouptut is the following:
CompletedProcess(args=’ conda activate CISmartContracts | slither . --checklist > analysis.md’, returncode=255, stdout=‘’, stderr=‘“slither” not recognized as internal or external command,\nprogram or executable batch file\n’)
How can I activate an environment and execute a command package inside that environment with subprocess or any other recommended python library?