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

use_python() throws "Error in python_config_impl(python)" in Windows 10 for Python 3.12.0 #1491

Closed
shivam7898 opened this issue Oct 6, 2023 · 2 comments

Comments

@shivam7898
Copy link

Python 3.12.0 was installed from www.python.org in Windows 10.

library(reticulate)

#Python 3.12 exists at the location shown below in windows 10
normalizePath(Sys.which("python"))
#[1] "C:\\Softwares\\Python\\Python312\\python.exe"

#Python directory exists in Windows PATH also
strsplit(Sys.getenv("PATH"),";")[[1]][14:15]
#[1] "C:\\Softwares\\Python\\Python312\\Scripts\\" "C:\\Softwares\\Python\\Python312\\" 

#Python Version
invisible(system('python --version'))
#Python 3.12.0

Following command used to work with previous Python 3.11 but does not work with the Python 3.12. Past working example can be seen Here. Additionally, This Issue seems to show a similar but different error and I tried using the path with or without python.exe but the error remains.

use_python("C:\\Softwares\\Python\\Python312\\python.exe")
#Error in python_config_impl(python) : 
#  Error 1 occurred running C:/Softwares/Python/Python312/python.exe: 
#In addition: Warning message:
#In system2(command = python, args = shQuote(script), stdout = TRUE,  :
#  running command '"C:/Softwares/Python/Python312/python.exe" "C:/Softwares/R/LibFiles/reticulate/config/config.py"' had status 1
py_config()
#Error in stop_no_virtualenv_starter(version = version, python = python) : 
#  Suitable Python installation for creating a venv not found.
#Please install Python with one of following methods:
#- https://www.python.org/downloads/
#- reticulate::install_python(version = '<version>')

To be frank, I have been away from the system for more than 6 months and had to update all including R, RStudio, and Python. So, please forgive me if the problem is not related to reticulate. Thanks for an awesome package and closing the issues I opened previously :)

Click to expand: sessionInfo()
sessionInfo()
#R version 4.3.1 (2023-06-16 ucrt)
#Platform: x86_64-w64-mingw32/x64 (64-bit)
#Running under: Windows 10 x64 (build 19045)
#
#Matrix products: default
#
#
#locale:
#[1] LC_COLLATE=English_India.utf8  LC_CTYPE=English_India.utf8    LC_MONETARY=English_India.utf8 LC_NUMERIC=C                  
#[5] LC_TIME=English_India.utf8    
#
#time zone: Asia/Calcutta
#tzcode source: internal
#
#attached base packages:
#[1] stats     graphics  grDevices utils     datasets  methods   base     
#
#other attached packages:
#[1] reticulate_1.32.0
#
#loaded via a namespace (and not attached):
#[1] compiler_4.3.1 Matrix_1.6-1.1 cli_3.6.1      Rcpp_1.0.11    grid_4.3.1     jsonlite_1.8.7 rlang_1.1.1    png_0.1-8      lattice_0.21-9
@shivam7898
Copy link
Author

Update to confirm that reticulate_1.32.0 works with python 3.11.6. As shown below, now py_config() can find both versions of python installed in the system but it is still unable to use python 3.12.0.

py_config()
#python:         C:/Softwares/Python/Python3116/python.exe
#libpython:      C:/Softwares/Python/Python3116/python311.dll
#pythonhome:     C:/Softwares/Python/Python3116
#version:        3.11.6 (tags/v3.11.6:8b6ee5b, Oct  2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]
#Architecture:   64bit
#numpy:          C:/Softwares/Python/Python3116/Lib/site-packages/numpy
#numpy_version:  1.26.0
#
#NOTE: Python version was forced by PATH
#
#python versions found: 
# C:/Softwares/Python/Python3116/python.exe
# C:/Softwares/Python/Python312/python.exe

@t-kalinowski
Copy link
Member

t-kalinowski commented Oct 12, 2023

Thanks for reporting, this is now fixed in the dev version of reticulate.

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