Code Monkey home page Code Monkey logo

Comments (5)

cooljl31 avatar cooljl31 commented on June 11, 2024

I forgot to mention the library correctly install

Requirement already satisfied: turbodbc in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: pybind11>=2.1.0 in /usr/local/lib/python3.6/site-packages (from turbodbc)
Requirement already satisfied: six in /usr/local/lib/python3.6/site-packages (from turbodbc)

this python script work

from turbodbc import connect

connection = connect(dsn = 'exasolution-io352fw_64')
cursor = connection.cursor()
cursor.execute("SELECT CATEGORY_NAME FROM STATISTICS.WEB_CATEGORY WHERE statistics.web_category.customer_id = 0001")

for row in cursor:
    print(row)

from go-python.

sbinet avatar sbinet commented on June 11, 2024

PyImport_ImportMode returns a PyObject*:
https://docs.python.org/2/c-api/import.html#c.PyImport_ImportModule

so the test:

	if turboExasol != nil {
		panic("could not inport turbodbc")
	}

should really read:

	if turboExasol == nil {
		panic("could not inport turbodbc")
	}

that said, do note that sbinet/go-python only supports Python-2, and it seems turbodbc is picked up from a python3.6 install (and has thus been, presumably, compiled against Python-3).

from go-python.

cooljl31 avatar cooljl31 commented on June 11, 2024

i have the same error on Python-2.7
screen shot 2017-09-14 at 9 53 14 pm

Requirement already satisfied: turbodbc in /usr/local/lib/python2.7/site-packages
Requirement already satisfied: pybind11>=2.1.0 in /usr/local/lib/python2.7/site-packages (from turbodbc)
Requirement already satisfied: six in /usr/local/lib/python2.7/site-packages (from turbodbc)

from go-python.

sbinet avatar sbinet commented on June 11, 2024

ok.
but... did you notice that PyImport_ImportModule returns the module so you should write:

if turboExasol == nil {
	panic("could not inport turbodbc")
}

ie: your if condition should be reversed.

from go-python.

sbinet avatar sbinet commented on June 11, 2024

Closing of old age.

from go-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.