Giter VIP home page Giter VIP logo

Comments (9)

GabrielDrapor avatar GabrielDrapor commented on July 30, 2024

I use 'go get' and meet the same problem too.

root@17c119383d9b:~# go get github.com/DataDog/go-python3
go: finding github.com/DataDog/go-python3 latest
# github.com/DataDog/go-python3
go/pkg/mod/github.com/!data!dog/[email protected]/import.go:125:14: could not determine kind of name for C.PyImport_GetModule

from go-python3.

viney avatar viney commented on July 30, 2024

go get github.com/DataDog/go-python3
errors.go:74:14: could not determine kind of name for C.PyErr_SetImportErrorSubclass

from go-python3.

ayush--s avatar ayush--s commented on July 30, 2024

get get succeeded without errors. this happened on build though:

> go build
# github.com/DataDog/go-python3
../../github.com/DataDog/go-python3/import.go:125:14: could not determine kind of name for C.PyImport_GetModule

from go-python3.

luowencai avatar luowencai commented on July 30, 2024

the same,while use glide get the package,and run some test demo
vendor/github.com/DataDog/go-python3/import.go:125:14: could not determine kind of name for C.PyImport_GetModule

from go-python3.

piccobit avatar piccobit commented on July 30, 2024

go get github.com/DataDog/go-python3
errors.go:74:14: could not determine kind of name for C.PyErr_SetImportErrorSubclass

  • 'PyErr_SetImportErrorSubclass' has been introduced in Python 3.6
  • 'PyImport_GetModule' has been introduced in Python 3.7

To me it looks like you have to update your Python version to v3.7 to get the support for both functions.

from go-python3.

hush-hush avatar hush-hush commented on July 30, 2024

Hi,

You will need the dev package for Python3 install that provide the Python.h header which define this all Python function. make sure it's in your resolution path for the compiler too.

Also @piccobit is right, this package is meant for python 3.7.

from go-python3.

marcofiocco avatar marcofiocco commented on July 30, 2024

I get lots of errors like:

> go get github.com/DataDog/go-python3
# github.com/DataDog/go-python3
/usr/local/lib/libpython3.7m.a(complexobject.o): In function `_Py_c_abs':
/opt/Python-3.7.4/Objects/complexobject.c:203: undefined reference to `hypot'
/usr/local/lib/libpython3.7m.a(complexobject.o): In function `_Py_c_pow':
/opt/Python-3.7.4/Objects/complexobject.c:132: undefined reference to `hypot'
/opt/Python-3.7.4/Objects/complexobject.c:133: undefined reference to `pow'
/opt/Python-3.7.4/Objects/complexobject.c:134: undefined reference to `atan2'
/opt/Python-3.7.4/Objects/complexobject.c:136: undefined reference to `sincos'
/opt/Python-3.7.4/Objects/complexobject.c:137: undefined reference to `exp'
/opt/Python-3.7.4/Objects/complexobject.c:138: undefined reference to `log'
/opt/Python-3.7.4/Objects/complexobject.c:132: undefined reference to `hypot'
/opt/Python-3.7.4/Objects/complexobject.c:133: undefined reference to `pow'
/opt/Python-3.7.4/Objects/complexobject.c:134: undefined reference to `atan2'
/opt/Python-3.7.4/Objects/complexobject.c:135: undefined reference to `sincos'
/opt/Python-3.7.4/Objects/complexobject.c:132: undefined reference to `hypot'
/opt/Python-3.7.4/Objects/complexobject.c:133: undefined reference to `pow'
/opt/Python-3.7.4/Objects/complexobject.c:134: undefined reference to `atan2'
/opt/Python-3.7.4/Objects/complexobject.c:136: undefined reference to `sincos'
/opt/Python-3.7.4/Objects/complexobject.c:137: undefined reference to `exp'
/opt/Python-3.7.4/Objects/complexobject.c:138: undefined reference to `log'
/usr/local/lib/libpython3.7m.a(complexobject.o): In function `_Py_c_abs':
/opt/Python-3.7.4/Objects/complexobject.c:203: undefined reference to `hypot'
/usr/local/lib/libpython3.7m.a(floatobject.o): In function `float_divmod':
/opt/Python-3.7.4/Objects/floatobject.c:629: undefined reference to `fmod'
/usr/local/lib/libpython3.7m.a(floatobject.o): In function `float_rem':
/opt/Python-3.7.4/Objects/floatobject.c:600: undefined reference to `fmod'
/usr/local/lib/libpython3.7m.a(floatobject.o): In function `float_divmod':
/opt/Python-3.7.4/Objects/floatobject.c:629: undefined reference to `fmod'
/usr/local/lib/libpython3.7m.a(floatobject.o): In function `float___round___impl':
/opt/Python-3.7.4/Objects/floatobject.c:1055: undefined reference to `round'
/opt/Python-3.7.4/Objects/floatobject.c:1058: undefined reference to `round'
/usr/local/lib/libpython3.7m.a(floatobject.o): In function `float_pow':
/opt/Python-3.7.4/Objects/floatobject.c:738: undefined reference to `fmod'
/opt/Python-3.7.4/Objects/floatobject.c:728: undefined reference to `fmod'
/opt/Python-3.7.4/Objects/floatobject.c:788: undefined reference to `pow'
/opt/Python-3.7.4/Objects/floatobject.c:764: undefined reference to `fmod'
/usr/local/lib/libpython3.7m.a(longobject.o): In function `PyLong_FromString':
/opt/Python-3.7.4/Objects/longobject.c:2287: undefined reference to `log'
/usr/local/lib/libpython3.7m.a(pytime.o): In function `_PyTime_RoundHalfEven':
/opt/Python-3.7.4/Python/pytime.c:100: undefined reference to `round'
/opt/Python-3.7.4/Python/pytime.c:103: undefined reference to `round'
/opt/Python-3.7.4/Python/pytime.c:100: undefined reference to `round'
/opt/Python-3.7.4/Python/pytime.c:103: undefined reference to `round'
/opt/Python-3.7.4/Python/pytime.c:100: undefined reference to `round'
/usr/local/lib/libpython3.7m.a(pytime.o):/opt/Python-3.7.4/Python/pytime.c:103: more undefined references to `round' follow
/usr/local/lib/libpython3.7m.a(dynload_shlib.o): In function `_PyImport_FindSharedFuncptr':
/opt/Python-3.7.4/./Python/dynload_shlib.c:83: undefined reference to `dlsym'
/opt/Python-3.7.4/./Python/dynload_shlib.c:96: undefined reference to `dlopen'
/opt/Python-3.7.4/./Python/dynload_shlib.c:127: undefined reference to `dlsym'
/opt/Python-3.7.4/./Python/dynload_shlib.c:96: undefined reference to `dlopen'
/opt/Python-3.7.4/./Python/dynload_shlib.c:102: undefined reference to `dlerror'
/usr/local/lib/libpython3.7m.a(posixmodule.o): In function `os_openpty_impl':
/opt/Python-3.7.4/./Modules/posixmodule.c:5951: undefined reference to `openpty'
/usr/local/lib/libpython3.7m.a(posixmodule.o): In function `os_forkpty_impl':
/opt/Python-3.7.4/./Modules/posixmodule.c:6045: undefined reference to `forkpty'
collect2: error: ld returned 1 exit status

I fixed it by adding:
Libs: -L${libdir} -lpython3.7m -lutil -lm -ldl
to python3.pc

from go-python3.

marcofiocco avatar marcofiocco commented on July 30, 2024

If I compile with Python 3.8 I get could not determine kind of name for PyEval_ReInitThreads

from go-python3.

hush-hush avatar hush-hush commented on July 30, 2024

Hi @marcofiocco, the lib only support python 3.7 currently. PyEval_ReInitThreads was removed in 3.8. I fixed the README to make this clear (thanks for raising the issue).

We do not plan on updating this to work with both 3.7 and 3.8 but if you would like to open a PR for this I'll be happy to review it.

I also updated the README to better explain that the python headers are needed to compile this package.
Default workflow looks like this (on Debian for example):

$> apt-get install python3.7-dev
$> go get github.com/DataDog/go-python3

Closing this issue, but feel free to reopen it or open another issue if needed.

from go-python3.

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.