-2

While trying to use Monet/Python Loader function,we are getting the following error pymonetdb.exceptions.OperationalError: 'pyapi.eval_loader' undefined in: pyapi.eval_loader(0x7f34f01f2c60:ptr, "{_emit.emit( { 'event_date': '2019-10-10', 'status': 1})};":str);

Followed the below steps for installation

Python installation steps:

We have installed python 3.6
1)yum install autoconf
2)yum install automake
3)yum install libtool
4)yum install openssl
5)yum install openssl-devel
6)yum install python-devel
7)Configured environment path settings for python   
    export PYTHONPATH=$PATH:/usr/local/lib/python3.6/site-packages

Monet installation steps: 1)git clone https://github.com/MonetDB/MonetDB.git 2)cd /MonetDB 3)./bootstrap 4)cd.. 5)mkdir testdir 6)cd testdir 7)../MonetDB/configure --enable-pyintegration=yes

While configuring we get the following status enabled message as below

py3integration is enabled

8)make
9)make install
10)monetdbd create /path/to/mydbfarm
11)monetdbd start /path/to/mydbfarm
12)monet stop -a
13)monet set embedpy=true
14)monet start -a
13)Enabled numpy(*pip install numpy*)

Created a loader by using the below python script

import pymonetdb
import sys
import os
connection = pymonetdb.connect(username="admin", password="admin@123", hostname="ipaddress", database="test")
cursor = connection.cursor()
cursor.execute("CREATE LOADER myloader() LANGUAGE PYTHON {_emit.emit( { 'event_date': '2019-10-10', 'status': 1})};") #create loader
cursor.execute("COPY LOADER INTO store FROM myloader();")  #append the row from loader to table
connection.commit()

While running the above script getting the following error

pymonetdb.exceptions.OperationalError: 'pyapi.eval_loader' undefined in:     pyapi.eval_loader(0x7f34f01f2c60:ptr, "{_emit.emit( { 'event_date': '2019-10-10', 'status': 1})};":str);

Please, help us to fix this issue.

  • People downvoting this question, what's wrong with you? It's a perfectly valid question, and well documented. – cornuz Dec 04 '19 at 10:10

1 Answers1

0

The likely reason is that you are mixing python 2 and 3.

yum install python3-devel python3-numpy
--enable-py3integration=yes
monetdb set embedpy3=true <database name>

Mind the 3. Also mind monetdb vs monet. And also that monetdb set ... needs a database name. You are setting parameters per database, not globally.

cornuz
  • 2,678
  • 18
  • 35