Questions tagged [rpython]

RPython (Restricted Python) is a restricted subset of the Python programming language

RPython (Restricted Python) is a restricted subset of the programming language used to write the PyPy Python interpreter. Unlike standard Python, RPython is statically typed, to allow efficient compilation.

More information about RPython can be found in the Pypy coding guide, especially regarding the restrictions when using RPython compared to Python.

63 questions
3
votes
1 answer

can't import package with rPython

I installed umap-learn on mac OS and tried to use it in r markdown file using rPython the way it is explained here: http://blog.schochastics.net/post/using-umap-in-r-with-rpython/#fn1 But when I run following code: ```{r} umap <-…
Nikita Vlasenko
  • 4,004
  • 7
  • 47
  • 87
3
votes
0 answers

Failing to run Python script from R because of module ImportErrors

I am trying to call a python script from an R Shiny app. I have tried using the system() function, which enters into the file properly but immediately fails after attempting to import any modules. system('python /path/to/name_of_file.py') Traceback…
eleh915
  • 65
  • 1
  • 6
3
votes
2 answers

RPython copy string with quotes from R to Python

I have trouble copying a string from R to a string in Python using RPython. I know the basic steps of doing it if the string does not have quotes but it gives error if the string has quotes. For example: test <-…
2
votes
0 answers

Importing Rpy with python 2.6, R2.14 and Win 7x64 error

I am trying to import rpy into python. I keep getting this error. Traceback (most recent call last): File "", line 1, in module import rpy File "E:\Python26\lib\site-packages\rpy.py", line 58, in module RVERSION =…
DanTheMan
  • 180
  • 9
2
votes
2 answers

PyPy Translation error

I hope this is the right place for this question. I'm trying to write a simple JIT-enabled interpreter. However, I'm hitting a odd error when it comes to translation. I've copied the JavaScript example parser almost verbatim, but here's my…
Timothy Baldridge
  • 10,455
  • 1
  • 44
  • 80
2
votes
1 answer

RPython segfaults on os.write

I am trying to embed some rpython code into python script via ctypes. RPython program is fairly simple: # check.py from rpython.rlib.entrypoint import entrypoint_highlevel from rpython.rtyper.lltypesystem import…
hello world
  • 596
  • 2
  • 12
2
votes
1 answer

Invoke rpython based functions from standard python code

I have been tinkering with pypy source tree for a week now and came up with a following question - is there any way to build a rpython program as a shared object which exposes some of its functionality (say a list of functions) for standard cpython…
hello world
  • 596
  • 2
  • 12
2
votes
0 answers

pypy translation failure on centos

Not sure whether this is right forum but I am not finding good help elsewhere. I am unable to translate PyPy 5.7.1 on a CentOS 6.7 system. I get following error. [c:writing] rpython_translator_c.c [translation:info] written:…
shrishinde
  • 3,219
  • 1
  • 20
  • 31
2
votes
0 answers

Unable to install rPython for windows

I have python 2.7.13 installed through Anaconda 2 and the latest version of R. I followed the instruction on https://github.com/cjgb/rPython-win and I ran the following code: library(devtools) install("C:/Users/Yang…
Waht
  • 301
  • 4
  • 14
2
votes
1 answer

rPython crashes when I try to load a .py file with pandas

rpytester.r and contains the following lines library(rPython) python.load("model.py") python.call("printme", "asdf") model.py contains the following line: def printme( str ): "This prints a passed string into this function" return str When…
Waht
  • 301
  • 4
  • 14
2
votes
1 answer

How to input arguments from R to Python with rPython?

How to input arguments from R to Python with the package rPython? Below is a naive attempt In script.py: print message In script.R: require(rPython) text = "Hello World" python.load("script.py", message=text) Error in python.load("script.py",…
Remi.b
  • 17,389
  • 28
  • 87
  • 168
2
votes
2 answers

Error in running a Python code from R with the package rPithon

I would like to run this Python code from R: >>> import nlmpy >>> nlm = nlmpy.mpd(nRow=50, nCol=50, h=0.75) >>> nlmpy.exportASCIIGrid("raster.asc", nlm) Nlmpy is a Python package to build neutral landscape models. The example comes from the…
Nell
  • 559
  • 4
  • 20
2
votes
0 answers

How to load python modules in Rstudio instance

Reproducible example. From bash try: $ R > library(rPython) > python.exec("help('modules')") I get loads, e.g. blaze itertools scipy blz itsdangerous see Now try the same in RStudio: >…
RobinLovelace
  • 4,799
  • 6
  • 29
  • 40
2
votes
3 answers

Environment variables and RStudio

I'm using RStudio and have been trying to use the rPython package to do some email handling for me. This involves unpacking some email attachments so I need to use a newer version of Python than 2.7. I am on ubuntu so I've set environment variables…
2
votes
2 answers

why do people say that RPython is an unpleasant language to program in

It is often stated that RPython is an unpleasant language to program in, for example, here, here, here or here. However, for example here in the original paper about RPython, it says quite the opposite: The result is a language that is more…
Albert
  • 65,406
  • 61
  • 242
  • 386