【发布时间】:2016-12-11 19:31:29
【问题描述】:
我曾尝试使用 Homebrew 安装 libret,但失败了。如何在 python 上使用 librets 库而无需使用 xcode 从头开始构建。
【问题讨论】:
标签: python macos osx-yosemite rets
我曾尝试使用 Homebrew 安装 libret,但失败了。如何在 python 上使用 librets 库而无需使用 xcode 从头开始构建。
【问题讨论】:
标签: python macos osx-yosemite rets
brew tap homebrew/boneyard 然后brew edit librets 然后将我的公式粘贴到下面并先保存,然后运行brew install librets
粘贴下面的内容以替换旧公式(我更新到 1.6.2,因此将旧的 SHA1 哈希注释为已过时)
require 'formula'
class Librets < Formula
homepage 'http://code.crt.realtors.org/projects/librets'
url 'https://github.com/NationalAssociationOfRealtors/libRETS/archive/1.6.2.tar.gz'
#sha256 '2eaf3d163899c7f3ffa303b24d90c2e3ed4f4a92dc8b12d4d1bc4effa3962661' (uncomment if you like)
depends_on 'swig'
depends_on 'boost'
depends_on 'autoconf'
def install
system "./autogen.sh"
system "./configure", "--disable-debug",
"--enable-shared_dependencies",
"--prefix=#{prefix}",
"--disable-dotnet",
"--disable-java",
"--disable-perl",
"--disable-php",
"--disable-ruby"
system "make install"
end
end
【讨论】:
site-packages 目录的权限。如果我的用户名是mike,我可以先输入以下内容:sudo chown mike:staff -R /Library/Python/2.7/site-packages,这样makefile 就可以将共享对象复制到该目录。
brew edit librets,我得到:Error: No available formula with the name "librets"
math.c 错误,例如 no member named 'islessequal' in global namespace。