Comments (5)
I think the problem is that rpy2 wants to initialize it's own instance of the R runtime, and when it's called via reticulate the R runtime is of course already initialized. Unfortunately I don't think we can find a way around this one.
from reticulate.
This sounds reasonable - though it's strange to me that the error is not always triggered by rpy2
.
For example, I don't have any problems sourcing numpy, matplotlib or pandas in the following environment :
conda create -n testenv3 python=3 scipy numpy pandas matplotlib
source activate testenv3
pip install rpy2
Rscript run_validate_setup2.R
yields output:
(testenv3) jacquelineburos@jacki1:~/projects/test-reticulate$ Rscript run_validate_setup2.R
python: /home/jacquelineburos/miniconda3/envs/testenv3/bin/python
libpython: /home/jacquelineburos/miniconda3/envs/testenv3/lib/libpython3.6m.so
pythonhome: /home/jacquelineburos/miniconda3/envs/testenv3:/home/jacquelineburos/miniconda3/envs/testenv3
version: 3.6.1 |Continuum Analytics, Inc.| (default, May 11 2017, 13:09:58) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
numpy: /home/jacquelineburos/miniconda3/envs/testenv3/lib/python3.6/site-packages/numpy
numpy_version: 1.12.1
python versions found:
/home/jacquelineburos/miniconda3/envs/testenv3/bin/python
/usr/bin/python
/usr/bin/python3
[1] "checking that numpy is available"
[1] "checking that matplotlib is available"
[1] "checking that rpy2 is available"
[1] "checking that python is initialized"
[1] "loading numpy"
[1] "loading matplotlib"
[1] "loading rpy2"
[1] "setup OK"
[1] "Finished"
Where run_validate_setup2.R
looks like the following:
#!/usr/bin/env Rscript
# execute script
source('validate_setup.function.R')
validate_setup(verbose = TRUE, test_packages = c('numpy', 'matplotlib', 'rpy2'))
print('Finished')
If it's OK with you, I'm going to keep working through dependencies of cohorts
to try to isolate the issue. My thinking is, in the long run, this might help make reticulate more reliable overall.
from reticulate.
from reticulate.
Nope you were right! the error occurs on installing PyVCF
, one of the dependencies of cohorts
, since that package uses rpy2 to initializes R in the code, but only if rpy2
is installed.
e.g. here:
try:
from rpy2 import robjects
except:
robjects = None
In general it seems safer to not have rpy2 installed, since otherwise would be hard to know which packages use it or depend on it. But simply installing it doesn't cause a problem unless one of the python packages uses it.
Anyways I feel better (at least) having tracked this down. Agreed with your earlier statement above that it's unlikely that anything can be done to avoid the issue. Circular r->py->r dependencies seem like a bad idea, in general.
from reticulate.
from reticulate.
Related Issues (20)
- Wrong PATH with use_condaenv when we choose any env except base one
- use_condaenv does not change actual env
- Support deactivate from conda HOT 2
- When passing python location I encounter '/c' not found HOT 2
- Conversion scope does not work in `py_to_r.pandas.core.frame.DataFrame` HOT 8
- NUMPY NOT FOUND BUT ACTUALLY INSTALLED HOT 7
- AttributeError: module 'jax.numpy' has no attribute 'product' HOT 1
- Release reticulate 1.37.0 HOT 1
- Release reticulate 1.36.1
- Support `results = 'hide'` directly in python engine HOT 2
- Interrupting keras training reliably produces a segfault HOT 5
- FR: R Print method for Python callables should show signature HOT 1
- Installing miniconda on Raspberry Pi HOT 2
- Release reticulate 1.37.0
- Custom conversion function no longer works with reticulate >= 1.36.0 HOT 4
- Convert NumPy recarray directly to R data.frame
- Need to reinstall reticulate whenever I want to access arcpy HOT 4
- Timeout when calling Async python function HOT 1
- Corrupt dataframe when converting from pandas to R HOT 5
- Release reticulate 1.38.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reticulate.