Comments (10)
I was able to fix this for my MacOS Sierra install by adding the following to my PKG_CONFIG_PATH
:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig
from go-python.
sure, here it is:
$ export GOPATH=$HOME/development/go
$ mkdir -p $GOPATH/src
$ cd $GOPATH/src
$ git clone git://github.com/sbinet/go-python github.com/sbinet/go-python
$ cd github.com/sbinet/go-python
$ make install
that said, even on OSX, a properly installed python-2.7.x (with the proper pkgconfig
support file(s)) should be usable with a simple #cgo pkgconfig: python-2.7
line.
how did you install this python-2.7.5
version?
what does this print?
$ pkg-config --list-all | grep python
python2 Python - Python library
python3 Python - Python library
python-2.7 Python - Python library
python-3.4 Python - Python library
python-3.4m Python - Python library
$ python2 --version
Python 2.7.10
from go-python.
Hi I tried the installation as recommend by you but without changing the cgo file, I get the following error:
`$ make install
go get -compiler="gc" .
warning: GOPATH set to GOROOT (/Users/pbandyop/Documents/HIIT/Mohammad_Internship/go) has no effect
pkg-config --cflags python-2.7
Package python-2.7 was not found in the pkg-config search path.
Perhaps you should add the directory containing python-2.7.pc' to the PKG_CONFIG_PATH environment variable No package 'python-2.7' found pkg-config: exit status 1 make: *** [install] Error 2
So, I changed the cgo
file to python-2.7.5
, then I get the following error:
`go get -compiler="gc" .
warning: GOPATH set to GOROOT (/Users/pbandyop/Documents/HIIT/Mohammad_Internship/go) has no effect
pkg-config --cflags python-2.7.5
Package python-2.7.5 was not found in the pkg-config search path.
Perhaps you should add the directory containing python-2.7.5.pc' to the PKG_CONFIG_PATH environment variable No package 'python-2.7.5' found pkg-config: exit status 1 make: *** [install] Error 2
I get no results with $ pkg-config --list-all | grep python
. If I do $ python --version
then I get Python 2.7.5
.
from go-python.
A couple of things:
As the go tool for you don't put GOPATH in the same place than GOROOT.
they might be sibling directories. But they shouldn't be the same directory.
How did you install python?
What platform are you using? Mac OSX I surmise...
(Sorry... I am at a conference this week with limited connectivity...)
from go-python.
(Ie: I haven't a Mac machine at ready until next week...)
from go-python.
Yes it is Mac OS. I installed Python through brew
. I have changed the GOROOT but still getting same error.
from go-python.
i just fix the problem in my mac:
assume you already install python(my is python2.7.5)
sudo easy_install pip
sudo pip install virtualenv
sudo pip install virtualenvwrapper
and add file python2.7.pc in /usr/lib/pkgconfig
here is the content:
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: Python
Description: Python library
Requires:
Version: 2.7
Libs.private: -lpthread -ldl -lutil
Libs: -L${libdir} -lpython2.7
Cflags: -I${includedir}/python2.7
from go-python.
I can run this package successful. My version of Python is 2.7.15. And the OS is ubuntu
from go-python.
I was able to fix this for my MacOS Sierra install by adding the following to my
PKG_CONFIG_PATH
:export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig
mac os arm64 , it did work
from go-python.
I was able to fix this for my MacOS Sierra install by adding the following to my
PKG_CONFIG_PATH
:export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig
This solution worked on macOS Catalina 10.15.7 w/ intel processors.
from go-python.
Related Issues (20)
- Does it works on Centos7 i686 system? HOT 1
- go get report errors HOT 4
- panic when register callback from go into python as module HOT 1
- How to call a function of Go from python HOT 3
- After running go-python script for a while, the memory becomes larger and larger HOT 1
- How to build the environment required by go-golang under window
- panic when run multi goroutine HOT 3
- Error reporting for execute command under win10 HOT 3
- Hi,
- Question: Usable with WebAssembly (WASM)? HOT 1
- Documentation not displayed due to license restrictions. HOT 2
- Pandas and go Python are incompatible? HOT 9
- D:\go\project\src\github.com\sbinet\go-python\capi.go:33:32: could not determine kind of name for C.METH_OLDARGS
- Exception SystemError: '/builddir/build/BUILD/Python-2.7.5/Objects/classobject.c:521: bad argument to internal function'
- can i import python module like selenium to use inside golang code?
- Let's try it, python bindings cgo-less HOT 1
- Cannot pass Integer type to CallFunction
- go panic when multi thread HOT 1
- How to use cPickle loads or dump complicated data, like array, class object
- memory leak๏ผ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-python.