Error in system2(python, args, stdout = TRUE, stderr = FALSE) : '""' not found
Hi, Thank you for the nice tutorial. I am getting error when I m deploying shiny. Also getting the same when running your codes locally. I have a following set up for python virtual enviroment.
(py36) C:\Users\shafi>where python C:\Users\shafi\anaconda3\envs\py36\python.exe C:\Users\shafi\anaconda3\python.exe
I deployed your shiny app successfully shiny-reticulate-app.
how do you create a virtual environment (example_env_name)? Are you creating this first? Do you create virtual env with python or R? `virtualenv_create(envname = "env22", version = install_python(version = "3.6.0")
I have the same problem
I found a solution to that. The .Rprofile is the issue. What .Rprofile essentially acts like an initialization function. As you could have guessed from reading the code inside it, it detects what environment you are running it on. In this case, I assume you and I are running locally. And .Rprofile will only be called when a new session is started.
Here is the step by step solution
- go to "tool" "Global Options" Python tab
- Copy the python interpreter path (This is where your "real" python is)
- go to .Rprofile
- In line 31, replace the path from "python3" to the path you just obtained
before
Sys.setenv(PYTHON_PATH = 'python3')
After
Sys.setenv(PYTHON_PATH = 'C:/Users/Owner/AppData/Local/Programs/Python/Python311/python.exe')
- Restart the session
- re-run the documentation as instructed.
Thank you for steps. It works fine locally with me too. I am having issue when deploying it on shiny server.