相关疑难解决方法(0)

用点子安装PIL

我正在尝试使用以下命令安装PIL(Python Imaging Library):

sudo pip install pil
Run Code Online (Sandbox Code Playgroud)

但我收到以下消息:

Downloading/unpacking PIL
  You are installing a potentially insecure and unverifiable file. Future versions of pip will default to disallowing insecure files.
  Downloading PIL-1.1.7.tar.gz (506kB): 506kB downloaded
  Running setup.py egg_info for package PIL
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py

Installing collected packages: PIL
  Running setup.py install for PIL
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py
    --- using frameworks …
Run Code Online (Sandbox Code Playgroud)

python installation pip python-imaging-library python-2.7

317
推荐指数
14
解决办法
74万
查看次数

无法在Mac OS x 10.9上安装Lxml

我想安装Lxml,然后我可以安装Scrapy.

当我今天更新我的Mac时它不会让我重新安装lxml,我收到以下错误:

In file included from src/lxml/lxml.etree.c:314:
/private/tmp/pip_build_root/lxml/src/lxml/includes/etree_defs.h:9:10: fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
         ^
1 error generated.
error: command 'cc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

我已经尝试使用brew来安装libxml2和libxslt,两者都安装得很好但我仍然无法安装lxml.

上次我安装时我需要在Xcode上启用开发人员工具,但由于它更新到Xcode 5,它不再给我这个选项了.

有谁知道我需要做什么?

python macos xcode lxml scrapy

233
推荐指数
10
解决办法
9万
查看次数

Ruby Gem安装Json在Mavericks和Xcode 5.1上失败 - 未知参数:' - multiply_definedsuppress'

我正在尝试运行gem install json并得到以下错误

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [generator.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /opt/boxen/repo/.bundle/ruby/2.0.0/gems/json-1.8.0 for inspection.
Results logged to /opt/boxen/repo/.bundle/ruby/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.0/gem_make.out
Run Code Online (Sandbox Code Playgroud)

我正在使用:

Os X:10.9.2
Xcode:5.1构建版本5B130a
命令行工具(CLT):5.1.0.0.1.1393561416
Ruby:ruby 2.0.0p247(2013-06-27修订版41674)[universal.x86_64-darwin13]
Ruby Gem:2.2 …

ruby macos rubygems

104
推荐指数
4
解决办法
5万
查看次数

lxml运行时错误:原因:不兼容的库版本:etree.so需要12.0.0或更高版本,但libxml2.2.dylib提供版本10.0.0

我有一个令人困惑的问题.我使用的是mac版本10.9,anaconda 3.4.1,python 2.7.6.

使用python-amazon-product-api开发Web应用程序.我克服了安装lxml的障碍,引用了clang错误:未知参数:' - mno-fused-madd'(python包安装失败).

但发生了另一个运行时错误 这是webbrowser的输出.

Exception Type: ImportError
Exception Value:    
dlopen(/Users/User_Name/Documents/App_Name/lib/python2.7/site-packages/lxml/etree.so, 2): Library not loaded: libxml2.2.dylib
Referenced from: /Users/User_Name/Documents/App_Name/lib/python2.7/site-packages/lxml/etree.so
Reason: Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0
Run Code Online (Sandbox Code Playgroud)

不确定如何继续并在此处和其他地方搜索此特定错误.任何帮助深表感谢!

python lxml amazon osx-mavericks

38
推荐指数
4
解决办法
2万
查看次数

安装python库时,"'cc'以退出状态1失败"错误

像许多其他人一样,我在安装python库时遇到问题(下载为tar,然后提取).

rodolphe-mbp:python-Levenshtein-0.11.2 Rodolphe$ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to python_Levenshtein.egg-info/requires.txt
writing python_Levenshtein.egg-info/PKG-INFO
writing namespace_packages to python_Levenshtein.egg-info/namespace_packages.txt
writing top-level names to python_Levenshtein.egg-info/top_level.txt
writing dependency_links to python_Levenshtein.egg-info/dependency_links.txt
writing entry points to python_Levenshtein.egg-info/entry_points.txt
reading manifest file 'python_Levenshtein.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'docs'
warning: no previously-included files matching '*pyc' found anywhere in distribution
warning: no previously-included files matching '.project' found anywhere in distribution
warning: no previously-included files matching '.pydevproject' …
Run Code Online (Sandbox Code Playgroud)

python clang osx-mavericks xcode5.1

36
推荐指数
3
解决办法
5万
查看次数

Python distutils,如何获得将要使用的编译器?

例如,我可以使用python setup.py build --compiler=msvc或者python setup.py build --compiler=mingw32仅使用python setup.py build,在这种情况下将使用默认编译器(例如bcpp).如何在setup.py中获取编译器名称(例如msvc,mingw32bcpp,分别)?

UPD.:我不需要默认的编译器,我需要实际使用的那个,这不一定是默认的.到目前为止,我还没有找到比解析更好的方法sys.argv来查看那里是否有--compiler...字符串.

python compiler-construction installation distutils

27
推荐指数
3
解决办法
1万
查看次数

通过pip安装gnureadline时出错

我试图升级到IPython 2.0时打破了我的IPython设置.安装时安装失败gnureadline.我原本有这个问题,但我修复了它.现在我收到这个错误:

cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. -Qunused-arguments -Qunused-arguments build/temp.macosx-10.9-intel-2.7/Modules/2.x/readline.o readline/libreadline.a readline/libhistory.a -lncurses -o build/lib.macosx-10.9-intel-2.7/gnureadline.so

clang: error: no such file or directory: 'readline/libreadline.a'

clang: error: no such file or directory: 'readline/libhistory.a'

error: command 'cc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools;__file__='/private/var/folders/jj/0w0dd3n16jq4g5579g6c7h040000gn/T/pip_build_root/gnureadline/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/jj/0w0dd3n16jq4g5579g6c7h040000gn/T/pip-iJITYv-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/var/folders/jj/0w0dd3n16jq4g5579g6c7h040000gn/T/pip_build_root/gnureadline
Storing complete log in /Users/mc/Library/Logs/pip.log
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助.

python linux pip

26
推荐指数
2
解决办法
1万
查看次数

Ansible安装-clang:错误:未知参数:' - mno-fused-madd'

所以,我发现其他一些铿锵错误似乎有些类似,但是,修复不适用于我的情况.

我正在使用OSX Mavericks,我们正在尝试安装Ansible.我有点正确安装,但是当我尝试安装Ansible时,我得到了这个clang错误.我们首先想到它可能是一个版本问题,所以我在使用gcc49遇到同样的错误后重新安装了gcc46,但我仍然遇到错误.

有谁知道如何解决这一问题?

来自pip.log日志文件的完整错误报告如下:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -Wall -Wstrict-prototypes -Wshorten-64-to-32 -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.9-intel-2.7/src/MD2.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

----------------------------------------
Cleaning up...
  Removing temporary dir /private/tmp/pip_build_root...
Command …
Run Code Online (Sandbox Code Playgroud)

gcc ansible osx-mavericks

23
推荐指数
2
解决办法
2万
查看次数

无法在Mac Mavericks上安装python mysql库

在Mountain Lion更新之前,它就像一个魅力.

更新后,它被破坏,我无法再次获得环境.

有人知道如何解决这个问题吗?

错误以粗体显示,如下所示.

fedorius@this:~$ pip install mysql-python
Downloading/unpacking mysql-python
  Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
  Running setup.py (path:/private/var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip_build_fedorius/mysql-python/setup.py) egg_info for package mysql-python

Installing collected packages: mysql-python
  Running setup.py install for mysql-python
    building '_mysql' extension
    cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64
    clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
    clang: …
Run Code Online (Sandbox Code Playgroud)

python django macos mysql-python osx-mavericks

14
推荐指数
1
解决办法
9947
查看次数

pip错误:无法识别的命令行选项'-fstack-protector-strong'

当我sudo pip install pyquery,sudo pip install lxmlsudo pip install cython,我得到非常相似的输出与相同的错误说:

x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’

这是完整的点子输出sudo pip install pyquery:

Requirement already satisfied (use --upgrade to upgrade): pyquery in /usr/local/lib/python2.7/dist-packages
Downloading/unpacking lxml>=2.1 (from pyquery)
  Running setup.py egg_info for package lxml
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.1.
    Building without Cython.
    Using build configuration of libxslt 1.1.28

Requirement already satisfied (use --upgrade to upgrade): cssselect in /usr/local/lib/python2.7/dist-packages/cssselect-0.9.1-py2.7.egg (from …
Run Code Online (Sandbox Code Playgroud)

python lxml pip cython pyquery

13
推荐指数
1
解决办法
3万
查看次数