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

How to choose the python path for Shiny-Server.conf #576

Open
Linhkust opened this issue Aug 8, 2024 · 0 comments
Open

How to choose the python path for Shiny-Server.conf #576

Linhkust opened this issue Aug 8, 2024 · 0 comments

Comments

@Linhkust
Copy link

Linhkust commented Aug 8, 2024

Hello, i am configuring shiny-server.conf for deploying my app on web.

Following the instructions:

Configure Python

Next, you need to tell Shiny Server how to find Python. You can point Shiny Server at either a Python binary (e.g. /usr/bin/python3) or an absolute path to a virtualenv (e.g. /srv/shiny-server/python39-venv). You can also provide a relative path to a virtualenv (e.g. .venv) in which case, SSOS will look for that directory relative to app.py. (Don’t forget that you need to pip install shiny and any other Python packages needed by your app(s), into whichever Python installation or virtualenv(s) you intend to use.)

Edit the file /etc/shiny-server/shiny-server.conf (root privileges are required). Add a line with python ; to the top of the file, leaving the rest of the file alone (at least for now). For example, if you wanted to use /usr/bin/python3, the end result might look like this:

# Use system python3 to run Shiny apps
python /usr/bin/python3;

# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;

# Define a server that listens on port 3838
server {
  listen 3838;

  # Define a location at the base URL
  location / {

    # Host the directory of Shiny Apps stored in this directory
    site_dir /srv/shiny-server;

    # Log all Shiny output to files in this directory
    log_dir /var/log/shiny-server;

    # When a user visits the base URL rather than a particular application,
    # an index of the applications available in this directory will be shown.
    directory_index on;
  }
}

I installed anaconda and the path for my interpreter is /home/user_name/anaconda3/bin/python. So i replaced
usr/bin/python3;
with
/home/user_name/anaconda3/bin/python.

But the web app cannot be opened with the log showing:
/home/lin/anaconda3/bin/python: permission denied

How can I fix this issue? Looking forward to your help!

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

1 participant