1. binet
  2. go-python
  3. Issues
Issue #6 open

Error installing

Anonymous created an issue

Hi, when I run make I get an error:

$ make (cd pkg/python && make) && (cd cmd/go-python && make) make[1]: Entering directory /home/bill/gocode/pkg/bitbucket.org/binet/go-python/pkg/python' CGO_LDFLAGS="python2 -c "import distutils.sysconfig, sys; sys.stdout.write('-L'+distutils.sysconfig.get_python_lib(0,1)+' -lpython')"`python2 -c "import distutils.sysconfig, sys; sys.stdout.write(''.join(distutils.sysconfig.get_config_vars('VERSION'))+'\n')"" CGO_CFLAGS="-Ipython2 -c "import distutils.sysconfig, sys; sys.stdout.write(distutils.sysconfig.get_python_inc()+'\n')" python2 -c "import distutils.sysconfig, sys; sys.stdout.write(''.join(distutils.sysconfig.get_config_vars('CFLAGS'))+'\n')"" go build -compiler="gc" .

_/home/bill/gocode/pkg/bitbucket.org/binet/go-python/pkg/python

none.go:6:11: error: function declaration isn't a prototype [-Werror=strict-prototypes] cc1: all warnings being treated as errors make[1]: [build] Error 2 make[1]: Leaving directory `/home/bill/gocode/pkg/bitbucket.org/binet/go-python/pkg/python' make: [install] Error 2

Comments (4)

  1. Anonymous

    Hi, I tried again from scratch but I still cant make it. Any ideas?

    ~/gocode/pkg/bitbucket.org/binet/go-python $  make
    (cd pkg/python && make) && (cd cmd/go-python && make)
    make[1]: Entering directory `/home/bill/gocode/pkg/bitbucket.org/binet/go-python/pkg/python'
    CGO_LDFLAGS="`python2 -c "import distutils.sysconfig, sys; sys.stdout.write('-L'+distutils.sysconfig.get_python_lib(0,1)+' -lpython')"``python2 -c "import distutils.sysconfig, sys; sys.stdout.write(''.join(distutils.sysconfig.get_config_vars('VERSION'))+'\n')"`" CGO_CFLAGS="-I`python2 -c "import distutils.sysconfig, sys; sys.stdout.write(distutils.sysconfig.get_python_inc()+'\n')"` `python2 -c "import distutils.sysconfig, sys; sys.stdout.write(''.join(distutils.sysconfig.get_config_vars('CFLAGS'))+'\n')"`" go build -compiler="gc" .
    # _/home/bill/gocode/pkg/bitbucket.org/binet/go-python/pkg/python
    /tmp/go-build548567547/_/home/bill/gocode/pkg/bitbucket.org/binet/go-python/pkg/python/_obj/_cgo_main.c:1:5: warning: function declaration isnt a prototype [-Wstrict-prototypes]
    # _/home/bill/gocode/pkg/bitbucket.org/binet/go-python/pkg/python
    exceptions.go: In function_cgo_6fd34fe6085e_Cfunc_PyErr_BadInternalCall’:
    exceptions.go:54:33: warning: unused variablea’ [-Wunused-variable]
    exceptions.go: In function_cgo_6fd34fe6085e_Cfunc_PyErr_Clear’:
    exceptions.go:72:33: warning: unused variablea’ [-Wunused-variable]
    exceptions.go: In function_cgo_6fd34fe6085e_Cfunc_PyErr_Print’:
    exceptions.go:167:33: warning: unused variablea’ [-Wunused-variable]
    exceptions.go: In function_cgo_6fd34fe6085e_Cfunc_PyErr_SetInterrupt’:
    exceptions.go:261:33: warning: unused variablea’ [-Wunused-variable]
    # _/home/bill/gocode/pkg/bitbucket.org/binet/go-python/pkg/python
    python.go: In function_cgo_6fd34fe6085e_Cfunc_PyEval_InitThreads’:
    python.go:34:33: warning: unused variablea’ [-Wunused-variable]
    python.go: In function_cgo_6fd34fe6085e_Cfunc_Py_Initialize’:
    python.go:52:33: warning: unused variablea’ [-Wunused-variable]
    # _/home/bill/gocode/pkg/bitbucket.org/binet/go-python/pkg/python
    utilities.go: In function_cgo_6fd34fe6085e_Cfunc_PyOS_AfterFork’:
    utilities.go:332:33: warning: unused variablea’ [-Wunused-variable]
    utilities.go: In function_cgo_6fd34fe6085e_Cfunc_PySys_ResetWarnOptions’:
    utilities.go:392:33: warning: unused variablea’ [-Wunused-variable]
    make[1]: Leaving directory `/home/bill/gocode/pkg/bitbucket.org/binet/go-python/pkg/python'
    make[1]: Entering directory `/home/bill/gocode/pkg/bitbucket.org/binet/go-python/cmd/go-python'
    CGO_LDFLAGS="" CGO_CFLAGS="" go build .
    main.go:5:8: import "bitbucket.org/binet/go-python/pkg/python": cannot find package
    make[1]: *** [build] Error 1
    make[1]: Leaving directory `/home/bill/gocode/pkg/bitbucket.org/binet/go-python/cmd/go-python'
    make: *** [install] Error 2
    
  2. David Wu

    I ran into the same error while trying to install go-python on Ubuntu. My golang was installed from the Ubuntu package manager.

    /usr/lib/go/pkg/bitbucket.org/binet/go-python$ make
    (cd pkg/python && make) && (cd cmd/go-python && make)
    make[1]: Entering directory `/usr/lib/go/pkg/bitbucket.org/binet/go-python/pkg/python'
    CGO_LDFLAGS="`python2 -c "import distutils.sysconfig, sys; sys.stdout.write('-L'+distutils.sysconfig.get_python_lib(0,1)+' -lpython')"``python2 -c "import distutils.sysconfig, sys; sys.stdout.write(''.join(distutils.sysconfig.get_config_vars('VERSION'))+'\n')"`" CGO_CFLAGS="-I`python2 -c "import distutils.sysconfig, sys; sys.stdout.write(distutils.sysconfig.get_python_inc()+'\n')"` `python2 -c "import distutils.sysconfig, sys; sys.stdout.write(''.join(distutils.sysconfig.get_config_vars('CFLAGS'))+'\n')"`" go build -compiler="gc" .
    # _/usr/lib/go/pkg/bitbucket.org/binet/go-python/pkg/python
    /tmp/go-build348043792/_/usr/lib/go/pkg/bitbucket.org/binet/go-python/pkg/python/_obj/_cgo_main.c:1:5: warning: function declaration isnt a prototype [-Wstrict-prototypes]
    # _/usr/lib/go/pkg/bitbucket.org/binet/go-python/pkg/python
    exceptions.go: In function _cgo_6fd34fe6085e_Cfunc_PyErr_Clear:
    exceptions.go:171:33: warning: unused variable a [-Wunused-variable]
    exceptions.go: In function _cgo_6fd34fe6085e_Cfunc_PyErr_SetInterrupt:
    exceptions.go:204:33: warning: unused variable a [-Wunused-variable]
    exceptions.go: In function _cgo_6fd34fe6085e_Cfunc_PyErr_Print:
    exceptions.go:308:33: warning: unused variable a [-Wunused-variable]
    exceptions.go: In function _cgo_6fd34fe6085e_Cfunc_PyErr_BadInternalCall:
    exceptions.go:338:33: warning: unused variable a [-Wunused-variable]
    # _/usr/lib/go/pkg/bitbucket.org/binet/go-python/pkg/python
    python.go: In function _cgo_6fd34fe6085e_Cfunc_Py_Initialize:
    python.go:43:33: warning: unused variable a [-Wunused-variable]
    python.go: In function _cgo_6fd34fe6085e_Cfunc_PyEval_InitThreads:
    python.go:52:33: warning: unused variable a [-Wunused-variable]
    # _/usr/lib/go/pkg/bitbucket.org/binet/go-python/pkg/python
    utilities.go: In function _cgo_6fd34fe6085e_Cfunc_PySys_ResetWarnOptions:
    utilities.go:58:33: warning: unused variable a [-Wunused-variable]
    utilities.go: In function _cgo_6fd34fe6085e_Cfunc_PyOS_AfterFork:
    utilities.go:316:33: warning: unused variable a [-Wunused-variable]
    make[1]: Leaving directory `/usr/lib/go/pkg/bitbucket.org/binet/go-python/pkg/python'
    make[1]: Entering directory `/usr/lib/go/pkg/bitbucket.org/binet/go-python/cmd/go-python'
    CGO_LDFLAGS="" CGO_CFLAGS="" go build .
    main.go:5:8: import "bitbucket.org/binet/go-python/pkg/python": cannot find package
    make[1]: *** [build] Error 1
    make[1]: Leaving directory `/usr/lib/go/pkg/bitbucket.org/binet/go-python/cmd/go-python'
    make: *** [install] Error 2
    
  3. David Wu

    This can be fixed by adding the following lines to ${GOROOT}/src/pkg/bitbucket.org/binet/go-python/cmd/go-python/Makefile:

    PYTHON:=python2
    PYTHON_VERSION:=`$(PYTHON) -c "import distutils.sysconfig, sys; sys.stdout.write(''.join(distutils.sysconfig.get_config_vars('VERSION'))+'\n')"`
    PYTHON_CFLAGS :=`$(PYTHON) -c "import distutils.sysconfig, sys; sys.stdout.write(''.join(distutils.sysconfig.get_config_vars('CFLAGS'))+'\n')"`
    PYTHON_CPPFLAGS:=`$(PYTHON) -c "import distutils.sysconfig, sys; sys.stdout.write(distutils.sysconfig.get_python_inc()+'\n')"`
    PYTHON_LDFLAGS:=`$(PYTHON) -c "import distutils.sysconfig, sys; sys.stdout.write('-L'+distutils.sysconfig.get_python_lib(0,1)+' -lpython')"`$(PYTHON_VERSION)
    CGO_LDFLAGS:=$(PYTHON_LDFLAGS)
    CGO_CFLAGS:=-I$(PYTHON_CPPFLAGS) $(PYTHON_CFLAGS)
    
    GO_COMPILER:=$(GC)
    ifeq ($(GO_COMPILER),)
        GO_COMPILER:="gc"
    endif
    
  4. Log in to comment