You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 24, 2023. It is now read-only.
sbinet/go-python only supports CPython2. CPython2 isn't supported anymore by python.org. Thus, sbinet/go-python is now archived.A possible alternative may be to use and contribute to go-python/cpy3 instead.
Naive go bindings towards the C-API of CPython-2.
this package provides a go package named "python" under which most of the PyXYZ functions and macros of the public C-API of CPython have been exposed.
theoretically, you should be able to just look at:
this package also provides an executable "go-python" which just loads "python" and then call python.Py_Main(os.Args).
the rational being that under such an executable, go based extensions for C-Python would be easier to implement (as this usually means calling into go from C through some rather convoluted functions hops)
Install
With Go 1 and the go tool, cgo packages can't pass anymore
additional CGO_CFLAGS from external programs (except pkg-config)
to the "fake" #cgo preprocessor directive.
go-python now uses pkg-config to get the correct location of
headers and libraries.
Unfortunately, the naming convention for the pkg-config package is
not standardised across distributions and OSes, so you may have to
edit the cgoflags.go file accordingly.
$ go get github.com/sbinet/go-python
If go get + pkg-config failed:
$ cd go-python
$ edit cgoflags.go
$ make VERBOSE=1
Note: you'll need the proper header and python development environment. On Debian, you'll need to install the python-all-dev package