2016-11-04 17 views
1

python-lzoをMac OS Sierraにインストールしようとしています。python-lzoをインストールする際にファイルが見つかりませんでした

$ virtualenv ./env 
$ . ./env/bin/activate 
$ pip install python-lzo 

私に次のように出力できます:

Collecting python-lzo 
    Using cached python-lzo-1.11.tar.gz 
Building wheels for collected packages: python-lzo 
    Running setup.py bdist_wheel for python-lzo: started 
    Running setup.py bdist_wheel for python-lzo: finished with status 'error' 
    Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/38/v_r4bjvx7dz626x16nh6jcn00000gn/T/pip-build-wDRYjx/python-lzo/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/38/v_r4bjvx7dz626x16nh6jcn00000gn/T/tmp_ueOY4pip-wheel- --python-tag cp27: 
    /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:251: UserWarning: 'licence' distribution option is deprecated; use 'license' 
    warnings.warn(msg) 
    running bdist_wheel 
    running build 
    running build_ext 
    building 'lzo' extension 
    creating build 
    creating build/temp.macosx-10.11-x86_64-2.7 
    clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/lzo -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c lzomodule.c -o build/temp.macosx-10.11-x86_64-2.7/lzomodule.o 
    lzomodule.c:35:10: fatal error: 'lzo1x.h' file not found 
    #include <lzo1x.h> 
     ^
    1 error generated. 
    error: command 'clang' failed with exit status 1 

    ---------------------------------------- 
    Running setup.py clean for python-lzo 
Failed to build python-lzo 
Installing collected packages: python-lzo 
    Running setup.py install for python-lzo: started 
    Running setup.py install for python-lzo: finished with status 'error' 
    Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/38/v_r4bjvx7dz626x16nh6jcn00000gn/T/pip-build-wDRYjx/python-lzo/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/38/v_r4bjvx7dz626x16nh6jcn00000gn/T/pip-8RUWxo-record/install-record.txt --single-version-externally-managed --compile: 
    /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:251: UserWarning: 'licence' distribution option is deprecated; use 'license' 
     warnings.warn(msg) 
    running install 
    running build 
    running build_ext 
    building 'lzo' extension 
    creating build 
    creating build/temp.macosx-10.11-x86_64-2.7 
    clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/lzo -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c lzomodule.c -o build/temp.macosx-10.11-x86_64-2.7/lzomodule.o 
    lzomodule.c:35:10: fatal error: 'lzo1x.h' file not found 
    #include <lzo1x.h> 
      ^
    1 error generated. 
    error: command 'clang' failed with exit status 1 

    ---------------------------------------- 
を、私は、仮想環境と pipを使用して python-lzoを試してみて、インストール

brew update 
brew install lzo 

:私は、c lzoライブラリをインストールするbrewを使用していました

lzo1x.hファイルが存在します:/usr/local/opt/lzo/include/lzo/またはbrewコマンド:

$ ls $(brew --prefix lzo)/include/lzo/ 

は、私はその後CFLAGS envronment変数を設定し、それでも同じエラーを持ってしようとしている:まだ

$ export EXTRA_CFLAGS=-I/usr/local/opt/lzo/include/lzo && export EXTRA_CXXFLAGS=-I/usr/local/opt/lzo/include/lzo && export EXTRA_LDFLAGS=-L/usr/local/opt/lzo/lib && pip install python-lzo 

同じエラー:

$ export EXTRA_CFLAGS=-I/usr/local/opt/lzo/include && export EXTRA_CXXFLAGS=-I/usr/local/opt/lzo/include && export EXTRA_LDFLAGS=-L/usr/local/opt/lzo/lib && pip install 

と絶望で

メッセージ、任意のアイデア?

- Updated--
またpipに直接変数を渡してみました:

pip install --global-option='build_ext' --global-option='-I/usr/local/opt' --global-option='-I/usr/local/opt/lzo/include/lzo' --global-option='-L/usr/local/opt/lzo/lib' python-lzo 

私は少し異なるエラーを取得この時間:

cmdoptions.check_install_build_global(options) 
Collecting python-lzo 
    Using cached python-lzo-1.11.tar.gz 
Skipping bdist_wheel for python-lzo, due to binaries being disabled for it. 
Installing collected packages: python-lzo 
    Running setup.py install for python-lzo ... error 
    Complete output from command /Users/myuser/dir/devel/lzo_example/env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/38/v_r4bjvx7dz626x16nh6jcn00000gn/T/pip-build-14vN3V/python-lzo/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -I/usr/local/opt -I/usr/local/opt/lzo/include/lzo -L/usr/local/opt/lzo/lib install --record /var/folders/38/v_r4bjvx7dz626x16nh6jcn00000gn/T/pip-Gq5pjs-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/emson/Dropbox/devel/aws/coursenut_bigdata/lzo_example/env/bin/../include/site/python2.7/python-lzo: 
    /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:251: UserWarning: 'licence' distribution option is deprecated; use 'license' 
     warnings.warn(msg) 
    running build_ext 
    building 'lzo' extension 
    creating build 
    creating build/temp.macosx-10.11-x86_64-2.7 
    clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/lzo -I/usr/local/opt/lzo/include/lzo -I/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c lzomodule.c -o build/temp.macosx-10.11-x86_64-2.7/lzomodule.o 
    In file included from lzomodule.c:35: 
    /usr/local/opt/lzo/include/lzo/lzo1x.h:33:10: fatal error: 'lzo/lzoconf.h' file not found 
    #include <lzo/lzoconf.h> 
      ^
    1 error generated. 
    error: command 'clang' failed with exit status 1 

感謝を

- 成功---

大きな感謝@daphtdazzあなたの解決策(下記参照)が機能しました! 私はlzoファイルの場所を取得するにはbrew --cellarコマンドを使用して、わずかにそれを変更した:

export C_INCLUDE_PATH=$(brew --cellar lzo)/2.09/include/lzo:$(brew --cellar lzo)/2.09/include/ export LIBRARY_PATH=/usr/local/lib pip install python-lzo

答えて

4

私はあなたと同じ結果を得ました、そして最終的にはこれが私の仕事:

export C_INCLUDE_PATH=/usr/local/Cellar/lzo/2.09/include/lzo:/usr/local/Cellar/lzo/2.09/include 
export LIBRARY_PATH=/usr/local/lib 
pip install python-lzo 

を(もちろん、あなたがインストールされているlzo醸造分布のバージョンに応じて、それらを微調整する必要があるかもしれません。私のための質問に答えたが、それらが正しく設定されていない理由を私は本当に理解していない...

は私もかかわらず、インストールXcodeデベロッパツールを持っている、と私は、彼らは」だと思う)

以前はbrewpipと衝突していました。私は一見を保つだろうと私はそれを動作させる場合、私はこの答えを更新します。

編集

python-lzoためsetup.pyファイルを見て持つことが起こっているすごみのビットは、具体的には、私はWindows上で両方がlzoを示唆している、追加されているパスが含まれていることを心配、ありますようですソース分布はあまりうまく整理されていません。しかし、brewをインストールしてmacOSでこれを実現する設計方法はないようです。そのため、インクルード部分は少なくとも余分な環境変数で解決するのが最善です。

+0

素晴らしいです!本当にありがとう。 'brew -cellar'コマンドを使うためにあなたのバージョンを少し修正しました:' export C_INCLUDE_PATH = $(brew -cellar lzo)/2.09/include/lzo:$(brew -cellar lzo)/2.09/include/; export LIBRARY_PATH =/usr/local/lib; pip install python-lzo' – emson

+0

後でbrewデータベース用に2.09から2.10に変更します –

0

私はMacOSのを使用していないが、あなたはENVを与えて試すことができます。変数をPIPに直接?

したがって、2回目の試行(エクスポートなし)と同じコマンドですが、& &はありません。また

foo=bar pim=pam pip install ...

は、あなたが不足しているファイルには、含まれたディレクトリに存在することを確認していますか?

+0

ありがとうございました....私はグローバルオプションパラメータとして渡してみました。 I/usr/local/opt/lzo/include/lzo ' - グローバルオプション=' build_ext ' - グローバルオプション=' - -global-option = ' - L/usr/local/opt/lzo/lib' python-lzoでも同様のエラーが表示されます - 上に表示されています – emson

関連する問題