62 questions
1
vote
1
answer
224
views
PyPy, RPython and Python versions compatibility when translation process
I'm trying to translate my RPython program using the PyPy 3.* packages as it appears on the download page.
I can translate my simple RPython program only using the 2.7 PyPy version but not using any ...
0
votes
1
answer
100
views
RPython jit logs
I've being working on a simple VM in RPython, translating it using Pypy to inspect JIT traces:
python ./.pypy/rpython/translator/goal/translate.py --opt=jit ${PWD}/src/awk_vm/awk_vm.py
Makefile
But ...
-1
votes
1
answer
37
views
Delete strings (support regex) stored in list from a text file [duplicate]
I'm trying to store a set of strings in a form of a list with the capability of supporting regular expressions and delete those strings from a file.
For example:
list = ['enabled','vs-index \d+']
...
0
votes
0
answers
216
views
How to use rpython translator to convert my python script into pypy?
I am using python 3.7 in windows 10 64-bit platform.
My python script contains mainly pyopengl graphics. My application works okay with python but I want to speed it up so I am trying to use pypy3 ...
0
votes
0
answers
105
views
rPython can't find Pandas
I seem to be having trouble with running a python app on my shiny server with rPython.
I set my python sys path,
Sys.setenv(PATH = paste("/Users/timmcwilliams/anaconda2/bin/", Sys.getenv("PATH"),...
3
votes
1
answer
3k
views
Connecting to DynamoDB using R
I would like to connect to DynamoDB with R. My ultimate goal is to create a Shiny App to display data that is stored at DynamoDB and updated frequently. So I need an efficient way to retrieve it using ...
0
votes
1
answer
116
views
Calling Python code from R
I am trying to call my python code from R. This is a simple code i have tried.
import tensorflow as tf
a1=tf.constant(23)
b1=tf.constant(25)
s1=tf.Session()
with tf.Session() as s1:
out=s1.run(...
0
votes
1
answer
206
views
RPython: Is it possible to specify/enforce a type on a variable?
I'm using os.read() to read a files' binary contents into a list. PyPy seems to have determined that all elements of the list will be of type int. Would it be possible to explicitly annotate the ...
3
votes
1
answer
2k
views
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 ...
5
votes
1
answer
8k
views
How to run python script in Rstudio
I have a problem on how to run a python script from Rstudio?
My initial idea is to grab the python script from a GitHub repository then run it in R, I grabbed python code by using script <- getURL(...
0
votes
1
answer
78
views
Using the rPython package for creating and "getting" a numpy array
I am trying to create a Rpackage that uses some python in it, in an attempt to better understand the rPython package I tried creating and getting back a Numpy Array:
This part works
library(rPython)
...
1
vote
1
answer
147
views
using R's rPython to run python's rpy2
I'm trying to use R to run a function I've written in python. That function uses some methods from R. So when I import the function from rPython, it crashes, probably due to circular import.
...
1
vote
1
answer
222
views
Error installing rPython (scrdir)
I am trying to install rPython but I get the following error about the scrdir installation. The scr file (makevars.win), as well as the configure.win file have the same path.
The path I am using is:
#...
4
votes
1
answer
858
views
rPython and __future__ imports
My python script starts with
from __future__ import division
In R I do
library(rPython)
python.load("myscript.py")
I get
File "", line 2 SyntaxError: from future imports must
occur at the ...
0
votes
1
answer
564
views
Using rPython import numpy with python 3.5
My R version is 3.4.1, python version is 3.5.2 , and OS is Ubuntu 16.04.2
I have set RPYTHON_PYTHON_VERSION=3.5 when installing rPython, which is my default python version for rPython.
♥ python.exec(...
2
votes
1
answer
204
views
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....
2
votes
1
answer
179
views
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 ...
2
votes
0
answers
44
views
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
[...
2
votes
0
answers
398
views
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)
...
0
votes
1
answer
72
views
Unable to locate to the right version of python on Mac
The big picture:
I am trying to let rPython package run python scripts that have packages such as numpy, scipy, and scikit-learn.
Now, if that is an impossible task, please let me know right away, ...
2
votes
1
answer
176
views
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 ...
2
votes
1
answer
1k
views
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"...
3
votes
0
answers
828
views
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.
...
2
votes
2
answers
2k
views
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 ...
0
votes
1
answer
1k
views
How do you import a Python library within an R package using rPython?
The basic question is this: Let's say I was writing R functions which called python via rPython, and I want to integrate this into a package. That's simple---it's irrelevant that the R function wraps ...
1
vote
0
answers
341
views
Running Tensor flow from R using rPython
I'm trying to use the Tensor flow Python module in RStudio using the package rPython. I am able to use the tensor flow module directly from Python.
I have a Python file called "run.py" which imports ...
0
votes
1
answer
178
views
Python code integration in R: works while development but not after release
I am developing a R package on RStudio platform. I have many functions written in python which I want to call using R. For now I just implemented a simple reverse complement function for a DNA ...
1
vote
1
answer
596
views
Change version of python in rPython?
I'm trying to run tensor flow with rPython in RStudio and rPython uses a different version of python than the one in my terminal.
How do you change which version rPython uses?
1
vote
0
answers
123
views
rPython and Tensorflow error when running session
i am currently trying to use tensorflow with R and rPython but i get a strange error when running a session.
here an example:
library(rPython)
python.exec("
import sys
from ctypes ...
0
votes
1
answer
139
views
R rPython remote computer's python
I want to build a Shiny app and control some hardware through it by using a raspberry pi's GPIO pins.
If I install R on pi itself and use code like
library(rPython)
python.exec("
...
2
votes
0
answers
536
views
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 ...
1
vote
1
answer
89
views
rPython method python.get returns weird encoding
I m trying to use rPython package to pass some arguments into python code and get results back. But for some reason I m getting weird encoding from my python code. Maybe someone has some hints to ...
3
votes
2
answers
250
views
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 ...
2
votes
3
answers
3k
views
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.
...
7
votes
5
answers
6k
views
rPython using wrong python installation on Mac OSX
I've installed python 2.7.8 alongside the 2.7.5 which comes with OSX 10.9.4.
Now how can I point rPython to python 2.7.8?
Attempt #1
I've modified the OSX .bash_profile as follows to point ...
0
votes
1
answer
686
views
Transforming a checkboxGroupInput object into a vector
After a long time searching for a possible answer I am still unable to create a character vector out of a user input (specifically checkboxGroupInput).
My ultimate purpose is to pass the user ...
4
votes
4
answers
2k
views
rPython installation fails, libpython not in linker paths
I got an error in R when building the rPython package, specifically the part that links against libpython2.7:
gcc -std=gnu99 -I/foo/bar/R-3.1.1/lib64/R/include -DNDEBUG -I/usr/local/include \
-I/...
0
votes
2
answers
720
views
Random String generator python
I made a simple program in Python to generate a random string with 5 numbers in it:
import random
numcount = 5
fstring = ""
for num in range(19): #strings are 19 characters long
if random....
0
votes
2
answers
800
views
RPython ord() with non-ascii character
I'm making a virtual machine in RPython using PyPy. My problem is, that I am converting each character into the numerical representation. For example, converting the letter "a" provides this result, ...
0
votes
1
answer
552
views
Stack Machine with Strings
I'm making a stack based virtual machine in RPython using the PyPy toolchain to convert the RPython to C. So far I have 4 instructions.
EOP - End of Program
EOI - End of Instruction
PUSH - Push item ...
1
vote
1
answer
355
views
PyPy translate 64bit
I can't seem to find the answer to this question anywhere. I'd just like to know, does the PyPy translate.py script produce 64bit or 32bit binary files? Is there an option to choose between the two ...
0
votes
2
answers
1k
views
rpy2 module is invisible from python 2.7 on Mac 10.6.8
I am a bit of a noob on Mac and my python installation is refusing to acknowledge the existence of the rpy2 module on my mac. It looks like it only sees it as a Python 2.6 module. How do I make it ...
0
votes
1
answer
355
views
R read string too long
Hi I have a string generated by Python and I need to read into R to analyze it.
The only difference between the two strings below is the length(number of elements inside list). And R cannot read the ...
3
votes
2
answers
884
views
why do people say that RPython is an unpleasant language to program in [closed]
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 ...
2
votes
1
answer
120
views
Making PyPy toolchain input-language-independent
What would be the steps involved in updating the PyPy toolchain, to allow one to substitute RPython with any well-defined statically-typed language (e.g "RRuby", "RJavaScript", or any subsets of ...
1
vote
2
answers
285
views
Game Library with Support for RPython
Are there any Python game libraries (Pygame, Pyglet, etc.) with support for RPython? Or game libraries specifically made for RPython? Or bindings for a game library for RPython?
4
votes
1
answer
968
views
Would Hindley Milner type inference be useful to PyPy for RPython?
Does PyPy do static type checking at compile time to catch type errors at compile time? And if not would something like HM type inference be useful to catch those errors at compile time?
0
votes
0
answers
239
views
How to link translated pypy/rpython to external jvm libraries?
I am trying to compile RPython code to JVM using pypy's translator toolchain.
However, there are many CPython libraries that are not supported, like urllib.urlopen() fails to translate to jvm.
Is it ...
16
votes
1
answer
3k
views
Where's the GIL in PyPy?
Is the PyPy GIL part of the PyPy interpreter implementation in RPython, or is it something that translate.py automatically adds? i.e., if I were to write my own new language interpreter in RPython ...
8
votes
1
answer
848
views
Options beyond RPython for writing interpreters w/ JITs?
I'm really interested in the PyPy project, but for the 1st (but less well-known) of its purposes listed below:
A set of tools for implementing interpreters for interpreted languages
An implementation ...