我在Ubuntu 11上使用easy_install安装lxml时遇到了困难.
当我输入时,$ easy_install lxml我得到:
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.3
Downloading http://lxml.de/files/lxml-2.3.tgz
Processing lxml-2.3.tgz
Running lxml-2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-7UdQOZ/lxml-2.3/egg-dist-tmp-GacQGy
Building lxml version 2.3.
Building without Cython.
ERROR: /bin/sh: xslt-config: not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
In file included from src/lxml/lxml.etree.c:227:0:
src/lxml/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or directory
compilation terminated.
Run Code Online (Sandbox Code Playgroud)
似乎libxslt或libxml2没有安装.我已尝试按照http://www.techsww.com/tutorials/libraries/libxslt/installation/installing_libxslt_on_ubuntu_linux.php …
我一直在尝试在Mac OS 10.9.3上安装Nokogiri,无论我尝试什么,安装最终都会失败,并显示以下错误消息:
$ sudo gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib
Building native extensions with: '--with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib'
This could take a while...
Building nokogiri using packaged libraries.
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib
Building nokogiri using packaged libraries.
checking for iconv.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... no
checking for libiconv_open() in iconv.h... no
checking for …Run Code Online (Sandbox Code Playgroud) 我将我的OSX(Lion)升级为Mavericks,我无法为我的项目安装Nokogiri.
我已经安装了XCode 5.0.1,命令行工具(使用xcode-select --install),并且已经从Homebrew安装了libxml2,我仍然遇到问题.
错误是:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb
checking for libxml/parser.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/bin/ruby
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include …Run Code Online (Sandbox Code Playgroud) 我收到了以下错误.
libxml/tree.h没有这样的文件或目录
我已经添加libxml2.dylib到我的项目中,但是我遇到了这种麻烦.请帮我.
我做了各种各样的研究,尝试了很多不同的东西.我知道这个问题已被多次回答,但没有一个建议的解决方案对我有用.
升级到Lion后,我在Ruby中遇到了分段错误.我相当自信是Nokogiri.所以我通过Homebrew安装了libxml2.我跑brew link libxml2.然后我使用该版本的库重新安装了Nokogiri.
证明:
$ nokogiri -v
# Nokogiri (1.5.0)
---
warnings: []
nokogiri: 1.5.0
ruby:
version: 1.9.2
platform: x86_64-darwin11.0.0
description: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]
engine: ruby
libxml:
binding: extension
compiled: 2.7.8
loaded: 2.7.8
Run Code Online (Sandbox Code Playgroud)
我已经将Nokogiri包含在我的gemfile的顶部,我也在我的环境文件中需要它.我不知道为什么我仍然会收到警告.
任何建议或想法,以确保它正在加载正确的版本libxml2?
我正在读这个堆栈溢出的答案
Mac用户并获得警告:Nokogiri是针对LibXML版本2.7.8构建的,但动态加载了2.7.3
我只是想知道他们在哪里学到了这个--with-xml2-config选项
brew install libxml2 --with-xml2-config
Run Code Online (Sandbox Code Playgroud)
所以我可以验证我真的想自己使用这个选项,所以我可以在将来更好地解决自制问题.
如何查看此特定选项的说明,更一般地说,在使用brew安装时,找出公式的所有可用选项?
我知道,brew info FORMULA让我一些类似的东西,但brew info libxml2只列出的选项--universal,--without-python以及--HEAD.
有关更多信息,这里是另一个堆栈溢出问题,类似于这个但不同:如何在安装之前获得有关brew公式的更多信息?
我试图使用此simplexml_load_string()Docs函数检查字符串的有效性为xml, 但它显示了很多警告消息.
如何检查字符串是否是有效的XML而不抑制(@在开头)错误并显示expec的警告函数
我刚刚安装了Xcode版本4.3.1,我收到此错误:
找不到libxml/tree.h文件
我也安装了Xcode 4.2,并且在同一项目中我得到了同样的错误.
我已经配置了标题搜索路径,/usr/include/libxml2
我也试过$(SDKROOT) / usr/include/libxml2,但它没有用.
我也把Other Linker Flag放了lxml2
Lastnight我将我的iPhone更新到iOS 6.1,因为我需要最新的版本,我当前的xcode版本无法构建到手机上.
我从xcode 4.5.2到xcode 4.6,我在我的项目文件中做了0次更改.
用什么编译完全没问题,现在给我一个文件找不到错误
#import <libxml/tree.h> 'libxml/tree.h' file not found
Run Code Online (Sandbox Code Playgroud)
我正确地将我的搜索路径链接起来
$(SDKROOT)/usr/include/libxml2
Run Code Online (Sandbox Code Playgroud)
和libxml2在构建阶段是链接和必需的.
编辑:
奇怪的是我将搜索路径改为以下内容并且瞧..
/usr/include/libxml2
Run Code Online (Sandbox Code Playgroud)
不知道为什么这已经解决了这个问题,任何人都可以告诉我xcode有什么变化吗?
我试图在我的mac上从源代码构建libxml2.
所以我使用mac ports安装了autoconf libtool和automake
autoconf和automake似乎正如预期的那样正常工作.
我首先尝试运行autogen.sh.
不幸的是,libtoolize --version给出了
-bash: libtoolize: command not found
Run Code Online (Sandbox Code Playgroud)
我尝试跑步(再次)
sudo port install libtool
---> Cleaning libtool
---> Scanning binaries for linking errors: 100.0%
---> No broken files found.
Run Code Online (Sandbox Code Playgroud)
我试试
locate libtool
Run Code Online (Sandbox Code Playgroud)
它似乎安装得很好
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man/man1/libtool.1
/Applications/Xcode.app/Contents/Developer/usr/bin/libtool
/Applications/Xcode.app/Contents/Developer/usr/share/man/man1/libtool.1
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/cross/mipsel-linux-binutils/files/110-uclibc-libtool-conf.patch
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool/Portfile
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool/files
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool/files/ltmain.m4sh-allow-clang-stdlib.diff
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool-devel
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool-devel/Portfile
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/openslp/files/libtool-tags.patch
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/t1lib/files/patch-libtool-tag.diff
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/print/pdflib/files/patch-libtool.diff
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/security/steghide/files/libtool-tag.diff
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/www/apache2/files/libtool-tag.diff
/usr/bin/libtool
/usr/lib/php/build/libtool.m4
/usr/share/apr-1/build-1/libtool
/usr/share/man/man1/libtool.1
Run Code Online (Sandbox Code Playgroud)
我如何让libtoolize工作?