Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 带有Python 3.7.0a的Mac OS X(10.12.6)安装lxml失败_Macos_Python 3.x_Lxml - Fatal编程技术网

Macos 带有Python 3.7.0a的Mac OS X(10.12.6)安装lxml失败

Macos 带有Python 3.7.0a的Mac OS X(10.12.6)安装lxml失败,macos,python-3.x,lxml,Macos,Python 3.x,Lxml,我已经用自制软件构建了libxslt(1.1.31)和libxml2(2.9.7),并制作了link: brew install libxml2 Warning: libxml2 2.9.7 is already installed brew install libxslt Warning: libxslt 1.1.31 is already installed xcode-select --install xcode-select: error: command line tools are

我已经用自制软件构建了libxslt(1.1.31)和libxml2(2.9.7),并制作了link

brew install libxml2
Warning: libxml2 2.9.7 is already installed
brew install libxslt
Warning: libxslt 1.1.31 is already installed
xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
echo $C_INCLUDE_PATH
安装了Xcode并尝试重新安装命令行工具

brew install libxml2
Warning: libxml2 2.9.7 is already installed
brew install libxslt
Warning: libxslt 1.1.31 is already installed
xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
echo $C_INCLUDE_PATH
导出的C\u INCLUDE\u路径

brew install libxml2
Warning: libxml2 2.9.7 is already installed
brew install libxslt
Warning: libxslt 1.1.31 is already installed
xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
echo $C_INCLUDE_PATH
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/

尝试过这个:

STATIC_DEPS=true pip install lxml
尝试轻松安装,并尝试从源代码构建。

但是,所有的方法都失败了。这真让我困惑

错误消息是:

/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DCYTHON_CLINE_IN_TRACEBACK=1 -I/usr/local/Cellar/libxslt/1.1.31/include -I/usr/local/Cellar/libxml2/2.9.7/include/libxml2 -Isrc -Isrc/lxml/includes -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/lxml/etree.c -o build/temp.macosx-10.6-intel-3.7/src/lxml/etree.o -w -flat_namespace


  src/lxml/etree.c:243289:21: error: no member named 'exc_state' in 'struct _ts'
      *type = tstate->exc_state.exc_type;
              ~~~~~~  ^
  src/lxml/etree.c:243290:22: error: no member named 'exc_state' in 'struct _ts'
      *value = tstate->exc_state.exc_value;
               ~~~~~~  ^
  [...(same error omitted)]
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  Compile failed: command '/usr/bin/clang' failed with exit status 1


  creating var
  creating var/folders
  creating var/folders/5m
  creating var/folders/5m/61f2z4pn75q0jbg65kn4cjzc0000gn
  creating var/folders/5m/61f2z4pn75q0jbg65kn4cjzc0000gn/T
  cc -I/usr/local/Cellar/libxslt/1.1.31/include -I/usr/local/Cellar/libxml2/2.9.7/include/libxml2 -I/usr/include/libxml2 -c /var/folders/5m/61f2z4pn75q0jbg65kn4cjzc0000gn/T/xmlXPathInitmvd417vw.c -o var/folders/5m/61f2z4pn75q0jbg65kn4cjzc0000gn/T/xmlXPathInitmvd417vw.o
  /var/folders/5m/61f2z4pn75q0jbg65kn4cjzc0000gn/T/xmlXPathInitmvd417vw.c:2:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
  main (int argc, char **argv) {
  ^
  1 warning generated.
  cc var/folders/5m/61f2z4pn75q0jbg65kn4cjzc0000gn/T/xmlXPathInitmvd417vw.o -L/usr/local/Cellar/libxslt/1.1.31/lib -L/usr/local/Cellar/libxml2/2.9.6/lib -lxml2 -o a.out
  ld: warning: directory not found for option '-L/usr/local/Cellar/libxml2/2.9.6/lib'
  error: command '/usr/bin/clang' failed with exit status 1
  Failed building wheel for lxml
尝试使用:
CFLAGS=“-O0”sudo pip安装lxml

希望这是heps