stocky-lion-5615306/19/2020, 11:00 AM
. Can anyone here tell me how to activate my venv in the
error: "/github/workspace/venv" doesn't appear to be a virtual environment
block please? Thanks!
creates a lightweight virtual environment in a
to install dependencies in the virtual environment, and sets the
venv\bin\pip install -r requirements.txt
which tells the CLI to use that virtual environment when subsequent commands (like
) are run. In prior versions, you’d have to do this manually and ensure you’d run
from an activated shell.
By default, a
file is generated for the project with an entry that excludes the
dir from Git, so by default the
dir won’t be included in any commits.
I’m guessing you’re seeing the error because you have
but no actual
directory in the repo?
We should consider improving the Pulumi GitHub Action to take the new
into account, creating the virtual environment (if it doesn’t exist) and installing dependencies into it automatically. I’ve opened https://github.com/pulumi/pulumi/issues/4871 to track this.
In the meantime, it’d probably be easiest to simply remove the
This does mean when developing the program locally on your machine you’ll need to manage a virtual environment yourself (if you don’t want to be installing dependencies globally on your machine). On macOS/Linux you can do this via:
, activate it by using
python3 -m venv venv
, and then install dependencies into it via
. Be sure to run
pip install -r requirements.txt
from the activated shell.
Or use a tool like Pipenv to create/manage the virtual environment.