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

Codeless Robyn Error in Model Tuning Step #210

Closed
sab26699 opened this issue Nov 5, 2021 · 19 comments
Closed

Codeless Robyn Error in Model Tuning Step #210

sab26699 opened this issue Nov 5, 2021 · 19 comments
Assignees

Comments

@sab26699
Copy link

sab26699 commented Nov 5, 2021

Project Robyn

I'm using the Codeless version of Robyn and keep running into the same issue in the 'Model Tuning' Step

Using the dummy data sets provided by FB. The Model Tuning step always shuts down the Codeless Robyn window in R Studio, and I get the console. I'm using R Version 4.1.1 and Codeless version of Robyn.


Running trial nr. 1out of 40...

Warning in normalizePath(path.expand(path), winslash, mustWork) :
path[1]="\fileserver2.centro.net": The specified path is invalid
Warning in normalizePath(path.expand(path), winslash, mustWork) :
path[1]="\fileserver2.centro.net": The specified path is invalid
Warning in read_python_versions_from_registry("HCU", key = "PythonCore") :
Unexpected format for PythonCore version: 3.10
Warning in read_python_versions_from_registry("HCU", key = "PythonCore") :
Unexpected format for PythonCore version: 3.10
Warning: Error in py_module_import: ModuleNotFoundError: No module named 'nevergrad'
[No stack trace available]

I'm pretty new to R and am not sure how to interpret these errors. Any guidance would be helpful. Thanks!

@sab26699 sab26699 changed the title Codeless Robyn Error in Model Tunining Step Codeless Robyn Error in Model Tuning Step Nov 5, 2021
@kyletgoldberg
Copy link
Contributor

Hi,
Glad to hear you are testing the codeless version. Right now, there are some dependency issues with Robyn & Python 3.10 so the best solution would be to set up your conda environment as Python 3.9. Try running this set of code in your Rstudio terminal and then running the app again and see if it works.
conda_create("r-reticulate", python_version=3.9)
conda_install("r-reticulate", "nevergrad", pip=TRUE)
use_condaenv("r-reticulate")
If it doesn't work, please run
py_config() and post the results here as well as the error message.

@sab26699
Copy link
Author

Hi Kyle,

Apologies for my delayed response. Thanks for the feedback. I ran the first code in R Studio and got the following errors:

conda_create("r-reticulate", python_version=3.9)
Error in conda_create("r-reticulate", python_version = 3.9) :
could not find function "conda_create"
conda_install("r-reticulate", "nevergrad", pip=TRUE)
Error in conda_install("r-reticulate", "nevergrad", pip = TRUE) :
could not find function "conda_install"
use_condaenv("r-reticulate")
Error in use_condaenv("r-reticulate") :
could not find function "use_condaenv"

I then tried running py_config(), which also didn't work and produced the error below:
Error in py_config() : could not find function "py_config"

I have Python 3.10 64 bit installed on my machine. Let me know of any other advice, thanks!

@kyletgoldberg
Copy link
Contributor

Hey there, no worries - could you make sure you have the reticulate library installed and loaded first and then try that again?

If you run library(reticulate) and it throws an error then run install.packages('reticulate') and then library(reticulate)

@sab26699
Copy link
Author

Thanks for the quick reply. I installed reticulate and ran library(reticulate) successfully. I then tried the first code you provided:

conda_create("r-reticulate", python_version=3.9)
conda_install("r-reticulate", "nevergrad", pip=TRUE)
use_condaenv("r-reticulate")

The first line runs properly, but the second is where errors start to pop up:
conda_install("r-reticulate", "nevergrad", pip=TRUE)
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/nevergrad/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/nevergrad/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/nevergrad/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/nevergrad/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/nevergrad/
Could not fetch URL https://pypi.org/simple/nevergrad/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/nevergrad/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement nevergrad (from versions: none)
ERROR: No matching distribution found for nevergrad
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Error: Error installing package(s): "nevergrad"

use_condaenv("r-reticulate")

This is where I'm getting confused - to the best of my knowledge, I have nevergrad installed. See screenshot of my Anaconda environments:

anaconda nevergrad 11 15 21

@kyletgoldberg
Copy link
Contributor

It looks like you have an environment called nevergrad rather than a package within the r-reticulate environment. This Stackoverflow answer will likely be able to help you, which operating system are you using?
https://stackoverflow.com/questions/45954528/pip-is-configured-with-locations-that-require-tls-ssl-however-the-ssl-module-in

@sab26699
Copy link
Author

Thanks for providing the Stack Overflow link. I spent some time with it this morning, but am unsure how to interpret it within the scope of the error I'm getting. Operating system is Windows 10.

I was able to get py_config to run, here are the results, not sure if it's helpful:

`py_config()
python: C:/Users/first.last/Anaconda3/python.exe
libpython: C:/Users/first.last/Anaconda3/python37.dll
pythonhome: C:/Users/first.last/Anaconda3
version: 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
Architecture: 64bit
numpy: C:/Users/first.last/Anaconda3/Lib/site-packages/numpy
numpy_version: 1.18.1

python versions found:
C:/Users/first.last/Anaconda3/envs/r-reticulate/python.exe
C:/Users/first.last/Anaconda3/python.exe
C:/Users/first.last/Anaconda3/envs/nevergrad/python.exe
Warning messages:
1: In read_python_versions_from_registry("HCU", key = "PythonCore") :
Unexpected format for PythonCore version: 3.10
2: In read_python_versions_from_registry("HCU", key = "PythonCore") :
Unexpected format for PythonCore version: 3.10
3: Python 'C:\Users\first.last\Anaconda3\envs\r-reticulate\python.exe' was requested but 'C:/Users/first.last/Anaconda3/python.exe' was loaded instead (see reticulate::py_config() for more information)

`

@kyletgoldberg
Copy link
Contributor

Okay that's good progress, could you try running these lines again and let me know if an error occurs?
conda_create("r-reticulate", python_version=3.9)
conda_install("r-reticulate", "nevergrad", pip=TRUE)
use_condaenv("r-reticulate")

@sab26699
Copy link
Author

Line 1 runs as expected, line 2 produces the error below:

conda_install("r-reticulate", "nevergrad", pip=TRUE) WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/nevergrad/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/nevergrad/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/nevergrad/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/nevergrad/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/nevergrad/ Could not fetch URL https://pypi.org/simple/nevergrad/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/nevergrad/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping ERROR: Could not find a version that satisfies the requirement nevergrad (from versions: none) ERROR: No matching distribution found for nevergrad Error: Error installing package(s): "nevergrad"

Line 3 doesnt run at all, since R Studio seems 'stuck' at line 2.

@gufengzhou
Copy link
Contributor

windows needs openssl if not already installed. In our readme right at the beginning under "getting started", there're two links to install/update guide of openssl for Windows. Can you try it out?

@sab26699
Copy link
Author

Thanks for that tip, I had not installed openssl yet. I followed in the instructions in THIS link and everything went smoothly. Openssl has been added to the path of my account, but I'm still getting the same installation error for nevergrad that I pasted above.

@kyletgoldberg
Copy link
Contributor

kyletgoldberg commented Nov 16, 2021

When you open the terminal and enter openssl version does it return anything? If not, try restarting your computer and trying again

@sab26699
Copy link
Author

Yes, it returns this:

OpenSSL 3.0.0 7 sep 2021 (Library: OpenSSL 3.0.0 7 sep 2021)

@kyletgoldberg
Copy link
Contributor

Could you try restarting your R session before re-running all of the code to make sure all of the libraries are reloaded correctly?

@sab26699
Copy link
Author

Confirming that even after restarting my R session, the code produces the same error I posted above, even after installing openssl and adding it to my user path.

@gufengzhou
Copy link
Contributor

Nevergrad installation could be quite tricky unfortunately. This whole thread Is about installing Nevergrad on different OS, including some solutions for Windows. Probably worth checking out.

@kyletgoldberg
Copy link
Contributor

@sab26699 were you able to resolve your nevergrad installation?

@sab26699
Copy link
Author

sab26699 commented Dec 9, 2021

@kyletgoldberg unfortunately, no. I didnt find any advice in the thread above that helped me install nevergrad.

@brry
Copy link

brry commented Jan 10, 2022

Fopr the warning Unexpected format for PythonCore version: 3.10
remotes::install_github("rstudio/reticulate") solves it, due to rstudio/reticulate@3544f7

@laresbernardo
Copy link
Collaborator

"Codeless Robyn" is currently in development on a private repo and will be released soon. It's being rebuilt entirely from scratch and will be shared as a complementary package for educational purposes. Stay tuned 👍

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

5 participants