RE: Queries regarding embedded python
Hi there, hope you are doing good. We were trying to implement Monetdb/python i.e. embedded python and tried the following code but its giving an error. (We have tried it on Linux) CREATE FUNCTION python_times_two(i INTEGER) RETURNS INTEGER LANGUAGE PYTHON { return i * 2 }; CREATE TABLE integers(i INTEGER); INSERT INTO integers VALUES (1), (2), (3), (4), (5); SELECT python_times_two(i) AS result FROM integers; Error: TypeException:user.s12_1[10]:'pyapi.eval' undefined in: X_18:int := pyapi.eval(0x7f051006a340:ptr,"{\n return i * 2\n};":str,X_17:int); Please help us on what should be done in order to code to work. Also need clarification on following points: 1. Does embedded R or embedded python work on windows? 2. Does it take data in memory when we use machine learning with Numpy and Scikitlearn? Awaiting for your response. Warm Regards, Ganesh Anbhule Data Scientist
Hey Ganesh, Did you enable embedded Python by starting the server with either "mserver5 --set embedded_py=true" or “monetdb set embedpy=true” as mentioned in the blogpost? You also need to install MonetDB/Python (on Linux there should be a package for it, or you can get it by compiling MonetDB with “--enable-pyintegration”. The startup messages of the server should contain “# MonetDB/Python module loaded”, otherwise something has gone wrong while loading. On Windows, the module is included with the default installer but you need to install Python 2 using the standard installer for it to work. Also, Python 2 should have the NumPy library installed. Embedded R does not work on Windows. Data will indeed be taken in memory when you use machine learning with NumPy/Sci-Kit learn. Regards, Mark
On 08 May 2017, at 10:40, Ganesh
wrote: Hi there, hope you are doing good.
We were trying to implement Monetdb/python i.e. embedded python and tried the following code but its giving an error. (We have tried it on Linux) CREATE FUNCTION python_times_two(i INTEGER) RETURNS INTEGER LANGUAGE PYTHON { return i * 2 };
CREATE TABLE integers(i INTEGER); INSERT INTO integers VALUES (1), (2), (3), (4), (5); SELECT python_times_two(i) AS result FROM integers;
Error: TypeException:user.s12_1[10]:'pyapi.eval' undefined in: X_18:int := pyapi.eval(0x7f051006a340:ptr,"{\n return i * 2\n};":str,X_17:int);
Please help us on what should be done in order to code to work.
Also need clarification on following points: 1. Does embedded R or embedded python work on windows? 2. Does it take data in memory when we use machine learning with Numpy and Scikitlearn?
Awaiting for your response.
Warm Regards, Ganesh Anbhule Data Scientist
_______________________________________________ users-list mailing list users-list@monetdb.org mailto:users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list https://www.monetdb.org/mailman/listinfo/users-list
participants (2)
-
Ganesh
-
Mark Raasveldt