Comments (9)
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.
go get github.com/DataDog/go-python3
errors.go:74:14: could not determine kind of name for C.PyErr_SetImportErrorSubclass
from go-python3.
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.
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.
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.
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.
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.
If I compile with Python 3.8 I get could not determine kind of name for PyEval_ReInitThreads
from go-python3.
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)
- python3.PyImport_ImportModule(name) will emit a fatal error when called the second time. HOT 5
- How do I create an Object HOT 2
- fatal error: Python.h: No such file or directory #include "Python.h" HOT 4
- get PyObject's refcount
- Error: C.PyEval_ReInitThreads
- could not determine kind of name for C.PyImport_GetModule HOT 2
- How to stop or terminate python execution? HOT 1
- Hi, How to capture function return when use python3.PyRun_AnyFile HOT 2
- could not determine kind of name for C.PyDict_ClearFreeList HOT 16
- PyEval_ReInitThreads removed since python 3.8 HOT 2
- build error on debian HOT 6
- Undefined reference to 'Py_True' HOT 4
- No module named xxx problem ,when the xxx is a so file .. HOT 2
- How could I Pass parameters from the Go side to the python file? HOT 2
- run on windows HOT 3
- SyntaxError: invalid syntax (uuid.py, line 138) HOT 1
- PyList_Insert and PyList_Append functions has an extra b HOT 2
- Goroutine calls Python but deadlocks HOT 2
- how can i use tensorflow with library HOT 2
- How do I create a Python bytes object HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-python3.