homebrew和pyenv冲突,homebrewpyenv冲突,求解homebrew安装


求解homebrew安装的python编译过程中添加了什么特殊的参数?原问题改为:homebrew 和 pyenv 存在什么冲突,该如何解决?

问题来源:1. 在osX上使用homebrew安装vtk模块时,会安装依赖的python,然后将vtk模块安装到brew安装的python中,使用系统python版本导入没有问题;2. 但是我使用的是pyenv管理python版本,所以当我使用brew安装好vtk模块,并且将其链接到pyenv管理下的python包路径中时,使用vtk模块报错:

[liangzb@ ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages]$ pyenv global system[liangzb@ ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages]$ python -c 'import vtk'[liangzb@ ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages]$ pyenv global 2.7.10[liangzb@ ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages]$ python -c 'import vtk'Fatal Python error: PyThreadState_Get: no current threadAbort trap: 6

类似的问题我在ubuntu上也碰到过,当时ubuntu上的报错是因为系统的python使用ucs4编译,而pyenv默认使用ucs2编译,将pyenv管理的python重新编译之后就可以正常使用。在osX上碰到这个问题,是否也是因为brew在安装python的过程中会添加特殊的编译参数。我尝试使用brew安装时的参数,但是似乎是非法的configure参数(以下参数除了prefix之外都复制了brew安装时的参数),调整部分参数编译成功后,问题任然存在:

$ ./configure --prefix=~/.pyenv/versions/2.7.10 --enable-ipv6 --enable-framework=~/.pyenv/versions/2.7.10/Framworks --without-ensurepip --without-gcc CPPFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk MACOSX_DEPLOYMENT_TARGET=10.10configure: WARNING: you should use --build, --host, --targetconfigure: WARNING: invalid host type: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdkconfigure: error: unrecognized option: `-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers'Try `./configure --help' for more information

我在stackoverflow上也看到类似的问题,但是是/System下的python和homebrew的python冲突,应该不一样

按@JeffreyLEE提供的地址:https://github.com/Homebrew/homebrew/issues/13654尝试将python和vtk重装,但是仍然存在问题:

[liangzb@ /Library/Frameworks]$ brew doctorPlease note that these warnings are just used to help the Homebrew maintainerswith debugging if you file an issue. If everything you use Homebrew for isworking fine: please don't worry and just ignore them. Thanks!Warning: "config" scripts exist outside your system or Homebrew directories.`./configure` scripts often look for *-config scripts to determine ifsoftware packages are installed, and what additional flags to use whencompiling and linking.Having additional scripts in your path can confuse software installed viaHomebrew if the config script overrides a system or Homebrew providedscript of the same name. We found the following "config" scripts:  /Users/liangzb/.pyenv/shims/python-config  /Users/liangzb/.pyenv/shims/python2-config  /Users/liangzb/.pyenv/shims/python2.7-config  /Users/liangzb/.pyenv/shims/python3-config  /Users/liangzb/.pyenv/shims/python3.4-config  /Users/liangzb/.pyenv/shims/python3.4m-config^C[liangzb@ /Library/Frameworks]$ brew configHOMEBREW_VERSION: 0.9.5ORIGIN: https://github.com/Homebrew/homebrewHEAD: 5d4f21fe8d0de114496e766e63124e7daf66d1eeLast commit: 24 hours agoHOMEBREW_PREFIX: /usr/localHOMEBREW_CELLAR: /usr/local/CellarHOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.comCPU: quad-core 64-bit haswellOS X: 10.10.4-x86_64Xcode: 6.4CLT: N/AClang: 6.1 build 602X11: 2.7.7 => /opt/X11System Ruby: 2.0.0-p481Perl: /Users/liangzb/.plenv/shims/perlPython: /Users/liangzb/.pyenv/shims/python => /Users/liangzb/.pyenv/versions/2.7.10/bin/python2.7Ruby: /usr/bin/rubyJava: 1.8.0_45

brew doctor显示pyenv的config文件可能会引起冲突,难道真的没办法共存了吗?

编橙之家文章,

评论关闭