How to build and install Python 3.7 on Fedora 36? #17
christian-korneck
started this conversation in
Usage Discussions
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi! Here is the code that works for me. package main
// #cgo pkg-config: python3-embed
// #include <Python.h>
import "C"
import (
"unsafe"
)
func main() {
pycodeGo := `
import sys
for path in sys.path:
print(path)
`
defer C.Py_Finalize()
C.Py_Initialize()
pycodeC := C.CString(pycodeGo)
defer C.free(unsafe.Pointer(pycodeC))
C.PyRun_SimpleString(pycodeC)
} Fedora release 37 (Thirty Seven) Thank you for tips above @christian-korneck |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How to build Python 3.7 on Fedora 36 for use with
go-python/cpy3
?Beta Was this translation helpful? Give feedback.
All reactions