Skip to content

code-runner run before loading environment #434

@jvellojin

Description

@jvellojin

Dear community,

I have Anaconda Python and a virtual environment MYENV inside of it. When trying to run the file using Code-Runner (in terminal or in the built-in terminal) I got an error because Code-runner runs before source and conda activate MYENV, i.e., It runs in the following order:

cd "/Users/<user>/.../<cwd>
python3 -u "/Users/<user>/.../app.py
source /Users/<user>/anaconda3/bin/activate
conda activate MYENV

How can I tell to vscode or code-runner to run in the correct order??:

source /Users/<user>/anaconda3/bin/activate
conda activate MYENV
cd "/Users/<user>/.../<cwd>
python3 -u "/Users/<user>/.../app.py

I'm running the latest version of vscode with the Code-Runner and Anaconda( with Python respectively) extensions in MacOS.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions