-
Notifications
You must be signed in to change notification settings - Fork 27
Closed as not planned
Labels
info-neededIssue requires more information from posterIssue requires more information from postertriage-needed
Description
VS Code tasks do not use the virtual environment configured for the project. They appear to be using the global environment no matter what, which results in them failing due to missing dependencies.
For instance, the following task configuration:
{
"label": "cdk synth",
"type": "shell",
"command": "npx aws-cdk synth",
"options": {
"cwd": "${fileDirname}",
},
"group": "build"
},
is equivalent to executing "cdk synth" from a directory containing the selected file (typically an app.py file alongside a cdk.json file).
When executing from the embedded terminal, the command succeeds (output varies.) When executed via a task, you get the following output:
Executing task in folder build: npx aws-cdk synth
source /home/john/source/Repos/Skynet/deploy/.venv/bin/activate
Traceback (most recent call last):
File "/home/john/source/Repos/Skynet/deploy/aws/stars/build/app.py", line 29, in <module>
import util
File "/home/john/source/Repos/Skynet/deploy/aws/stars/build/../../lib/util/__init__.py", line 1, in <module>
from ._config_impl import (
File "/home/john/source/Repos/Skynet/deploy/aws/stars/build/../../lib/util/_config_impl.py", line 18, in <module>
import boto3
ModuleNotFoundError: No module named 'boto3'
python3 app.py: Subprocess exited with error 1
While the correct virtual environment is being output with the source command, the environment is not actually being activated, otherwise the boto3 module would be found.
Metadata
Metadata
Assignees
Labels
info-neededIssue requires more information from posterIssue requires more information from postertriage-needed