Issue #3 open

Failed to install package (golang-weekly)

kingj
created an issue

{{{ $ sudo go get -a -v bitbucket.org/binet/go-python/pkg/python runtime errors sync/atomic unicode math sync io syscall unicode/utf8 bytes strings time os strconv reflect fmt runtime/cgo bitbucket.org/binet/go-python/pkg/python

bitbucket.org/binet/go-python/pkg/python

dict.go:3:20: fatal error: Python.h: No such file or directory compilation terminated. }}}

I have python-dev, so I this shouldn't be an error?

Thanks for your help!

Comments (6)

  1. kingj reporter
    • changed status to open

    Got it to work! Needed to add flags... it didn't know where the directory was?

    Maybe this could be put into the readme?

    $ sudo CGO_CFLAGS="-I/usr/include/python2.7" CGO_LDFLAGS="-lpython2.7 -L/usr/lib" go get -a -v bitbucket.org/binet/go-python/pkg/python
    [sudo] password for shuriken: 
    runtime
    errors
    sync/atomic
    unicode
    math
    sync
    io
    syscall
    unicode/utf8
    time
    bytes
    strings
    os
    strconv
    reflect
    fmt
    runtime/cgo
    bitbucket.org/binet/go-python/pkg/python
    

    Edit: Don't know if I should mark this as closed/resolved -- I'll leave it up to you.

  2. binet repo owner

    hi,

    I have updated the install instructions in the README. it now makes use of a top-level Makefile which will forward to the 'go' tool with the correct CGO_CFLAGS and CGO_LDFLAGS variables. (works on my machine, let me know)

    -s

  3. kingj reporter

    Hrmm, when I deleted the package from my go pkg/linux_amd64/... directory and ran go get again, it came up with the same error/complaint about Python.h -- am I doing something wrong?

  4. binet repo owner

    you mean you re-ran 'go get' with the same CGO_xyz tweaks and it didn't work or you tried a bare 'go get' ? the bare 'go get' won't work. but fetching/cloning the repo and running 'make' at its root directory should.

    -s

  5. kingj reporter

    Aha, no I didn't try it that way!

    I see the new install message, I think this should suffice. You might consider putting the shortcut one line command in the readme as well:

    sudo CGO_CFLAGS="-I/usr/include/python<version>" CGO_LDFLAGS="-lpython<version> -L/usr/lib" go get -a -v bitbucket.org/binet/go-python/pkg/python
    

    Since that works without needing to do the hg clone etc.

  6. Log in to comment