2017-05-31 6 views
0

Mac OS X 10.11.6ではnsetoolsを使用できません。Mac OS X 10.11.9でnsetoolsを使用できない

sudo pip install nsetools 
Password: 
The directory '/Users/debraj/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
The directory '/Users/debraj/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
Collecting nsetools 
Downloading nsetools-1.0.5.tar.gz 
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from nsetools) 
Installing collected packages: nsetools 
Running setup.py install for nsetools ... done 
Successfully installed nsetools-1.0.5 

スーパーユーザーではなくnsetoolsをインストールしようとしました。

sudo -H pip install six 
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python 
- :私は sixがインストールされているにもかかわらず

python 
Python 2.7.11 (default, Jan 22 2016, 16:30:50) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> from nsetools import Nse 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "/Library/Python/2.7/site-packages/nsetools/__init__.py", line 25, in <module> 
    from .nse import Nse 
    File "/Library/Python/2.7/site-packages/nsetools/nse.py", line 26, in <module> 
    import six 
ImportError: No module named six 

- :私は以下のエラーを取得していますnsetoolsを使用しようとしている上

pip install nsetools 
Collecting nsetools 
    Downloading nsetools-1.0.5.tar.gz 
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from nsetools) 
Installing collected packages: nsetools 
    Running setup.py install for nsetools ... error 
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/lp/3q9_2mn51hd9s4yj_jcf3jxm0000gp/T/pip-build-nEc2HK/nsetools/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/lp/3q9_2mn51hd9s4yj_jcf3jxm0000gp/T/pip-gh3BsV-record/install-record.txt --single-version-externally-managed --compile: 
    running install 
    running build 
    running build_py 
    creating build 
    creating build/lib 
    creating build/lib/nsetools 
    copying nsetools/__init__.py -> build/lib/nsetools 
    copying nsetools/bases.py -> build/lib/nsetools 
    copying nsetools/nse.py -> build/lib/nsetools 
    copying nsetools/utils.py -> build/lib/nsetools 
    running install_lib 
    creating /Library/Python/2.7/site-packages/nsetools 
    error: could not create '/Library/Python/2.7/site-packages/nsetools': Permission denied 

    ---------------------------------------- 
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/lp/3q9_2mn51hd9s4yj_jcf3jxm0000gp/T/pip-build-nEc2HK/nsetools/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/lp/3q9_2mn51hd9s4yj_jcf3jxm0000gp/T/pip-gh3BsV-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/lp/3q9_2mn51hd9s4yj_jcf3jxm0000gp/T/pip-build-nEc2HK/nsetools/ 

- :しかし、それは以下のエラーを投げていました

誰かが間違っていることを教えてもらえますか?

+0

スーパーユーザーとしてパッケージをインストールする理由は? – errata

+0

「エラー:作成できませんでした」/Library/Python/2.7/site-packages/nsetools ':許可が拒否されました。 – tuk

答えて

1

sudoのpipパッケージをインストールしないでください。代わりに、virtualenvpyenvなど、Pythonで仮想環境を使用する方法をお読みください。仮想環境がなければ、あなたが言及したようなエラーに常に直面します。

これは、仮想環境のセットアップのお手伝いをする必要があります。

$ pip install virtualenv 
$ virtualenv your_virtualenv_name 
$ source your_virtualenv_name/bin/activate 
(your_virtualenv_name) $ pip install nsetools 

読むthis articleは、仮想環境、その目的と使用方法についてのアイデアを得るために。

+0

通常のユーザーとして 'nsetools'をインストールしようとすると、私はエラーを表示して質問を更新しました。 'sudo python'を実行して' nsetools'をインポートしようとすると、同じエラーが出ます。 'sudo'を使わずに' pip install six'を実行すると 'Require already already satisfied:6 in/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python' – tuk

+0

私の答えが更新されました...ピップパッケージのインストールにsudoを使用しないでください! :)代わりに、それらを適切に単一のユーザーとしてインストールする方法を見つけてください。仮想環境は、この種の問題に関連するすべての問題を解決するはずです。 – errata

+0

私はすでに今すぐインストールしています。 'pip install nsetools'を実行すると、' Requirement is already satisfied'が表示されます。あなたは 'nsetools'を今どのように使うことができるのか教えていただけますか? – tuk