Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extension defaulting to /usr/bin/python3, but using /usr/local/bin/python #20

Closed
nick-youngblut opened this issue Nov 19, 2023 · 1 comment

Comments

@nick-youngblut
Copy link

When I try to run my Shiny python app with the extension via the run button, I get the following:

/usr/bin/python3 -m shiny run --port 45287 --reload "/workspaces/MY_APP/app.py"
/usr/bin/python3: No module named shiny

The extension is defaulting to /usr/bin/python3, but I'm using the /usr/local/bin/ python install.

I don't see any docs on changing the path used by the extension for running shiny run. It would be helpful to have more docs on changing the extension settings.

For reference, my VS Code .devcontainer.json file:

{
    "name": "MY_APP",
    "build": {
        "dockerfile": "Dockerfile",
        "context": ".."
    },
    "extensions": [
        "github.copilot",
        "github.copilot-chat",
        "ms-python.python",
        "ms-azuretools.vscode-docker",
        "codezombiech.gitignore",
        "Gruntfuggly.todo-tree",
        "redhat.vscode-yaml",
        "george-alisson.html-preview-vscode",
        "posit.shiny-python"
    ],
    "settings": {
        "python.linting.enabled": true,
        "python.linting.pylintEnabled": true,
        "python.analysis.typeCheckingMode": "basic",
        "python.analysis.diagnosticSeverityOverrides": {
            "reportUnusedFunction": "none"
        }
    },
    "features": {
        "ghcr.io/devcontainers/features/docker-in-docker:2": {
        "version": "latest"
        }
    }
}

My dockerfile:

FROM python:3.9-slim

WORKDIR /app

RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    software-properties-common \
    git \
    libpq-dev \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

COPY ../requirements.txt ./

RUN pip3 install -r requirements.txt
@jcheng5
Copy link
Collaborator

jcheng5 commented Feb 28, 2024

Thanks for the feedback. We use whatever Python interpreter the VS Code Python extension has selected. You can change this by using the "Python: Select Interpreter" command. I'll add a note for this in the docs.

@jcheng5 jcheng5 closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants