-
Notifications
You must be signed in to change notification settings - Fork 330
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
Reticulate 1.38.0 for R 4.2.1 can install but not import numpy, ... #1626
Comments
I suspect (but haven't tested) this is a CentOS 7 issue, with the system BLAS version installed being too old for the latest NumPy. Does rolling back NumPy fix the issue? py_install("numpy<2") If that doesn't work, would you be able to reduce this down to a minimal example I could reproduce locally? i.e., library(reticulate)
virtualenv_create(force = TRUE, version = "3.9")
np_array(1:3) which for me gives:
|
Thanks for taking a look, Tomasz! Your compact example demonstrates a problem on my end. All is well until the
Same diagnostics as before attached as r-session-fail.log.
|
I've put together a minimal Dockerfile starting from centos7, and installing R and Python. Everything seems to work fine. Would you be able to iterate on this Dockerfile until you can reproduce the error in it? FROM centos:7
RUN `which sudo` yum install -y https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.$(arch).rpm
RUN rig add release
RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
RUN R -q -e 'pak::pkg_install("reticulate")'
RUN yum install -y git
RUN yum install -y gcc make patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel xz-devel
RUN R -q -e 'reticulate::install_python("3.9")'
RUN R -q -e 'reticulate::virtualenv_create()'
RUN R -q -e 'reticulate::np_array(1:3)' Run from bash with: docker build -t reticulate-centos7 -f centos7.Dockerfile . |
I don't find docker in my env ('which' finds no docker in path). I tried in the Docker Playground and the sessions spontaneously shut down just as they install_python() - the start of those last three RUN steps (screenshots, even though the playground session should not time out after a few minutes). I'll report to our infrastructure team and see if they can track down the conflict. |
Instead of building Python from source with |
Is this issue back, reticulate virtualenv will not allow numpy to pass sanity checks?
Please note I have user access to my env, so ability to change most wiring is restricted.
py_install( ... "--force-reinstall" ...)
worked, as advised in the prior issue, but import then fails.The numpy sanity error is at the bottom:
RuntimeError: The current Numpy installation ('/local-home/repos/project/.venv/lib/python3.9/site-packages/numpy/__init__.py') fails to pass simple sanity checks. This can be caused for example by incorrect BLAS library being linked in, or by mixing package managers (pip, conda, apt, ...). Search closed numpy issues for similar problems.
utils::sessionInfo()
RStudio.Version()
reticulate::py_config()
import error
The text was updated successfully, but these errors were encountered: