go-python
go-python copied to clipboard
go get report errors
Wrong information:
go-python
In file included from .\capi.go:3:0: ./go-python.h:4:20: fatal error: Python.h: No such file or directory #include "Python.h" ^ compilation terminated
I got the same mistake。 I‘m build on windows 10.
E:\work\go\go-common-util>go get github.com/sbinet/go-python #github.com/sbinet/go-python In file included from ..\pkg\mod\github.com\sbinet\[email protected]\capi.go:3: ./go-python.h:4:10: fatal error: Python.h: No such file or directory #include "Python.h" ^~~~~~~~~~ compilation terminated.
same
# github.com/sbinet/go-python
In file included from D:\GOPATH\pkg\mod\github.com\sbinet\[email protected]\capi.go:3:
./go-python.h:4:10: fatal error: Python.h: No such file or directory
4 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
what can i do ?
instructions for the compilation failures are noted on the README
:
- https://github.com/sbinet/go-python#install
these compilation failures usually boil down to cgo
not being able to locate the CPython development headers.
one needs to:
- make sure these development headers are properly installed
e.g.:
apt install python2-dev
on a Debian-like distribution - make sure these development headers can be found by
cgo
(either by installingpkgconfig
support files for CPython2, or by editingcgoflags.go
ingo-python
)