Closed zznan0o0 closed 6 years ago
add this code before your fmt.Printf("importing kwargs...\n")
python.PyRun_SimpleString("import sys")
python.PyRun_SimpleString("sys.path.append('/DATA/Work/CODE/GO/GOPATH/src/github.com/sbinet/go-python/tests/kw-args')")
You could also do something like this
d, _ := os.Getwd()
python.PyRun_SimpleString("import sys")
python.PyRun_SimpleString(
fmt.Sprintf("sys.path.append('%v')", workingDir))
Does anyone know why this does not happen in the Initalize()
function?
adding it from the go-python.Initialize
function would be a bit unpolite.
another simple way is to add .
(or any other directory) to $PYTHONPATH
.
excuse me I'm run the example of kw-args and modify-values under the tests but error: importing kwargs... 2017/10/14 05:47:31 could not import 'kwargs' exit status 1
the other is the same
i'm ubuntu 16.04, Python 2.7.12, go 1.6