2017-01-04 13 views
14

jsonモジュールをインストールできない。 私が知る限り、私はsudoを使うべきではありません。どうしたの?"pip install json"がUbuntuで失敗する

pip install json 
The directory '/home/snow/.cache/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 '/home/snow/.cache/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 json 
    Downloading json-99.0.tar.gz 
    Complete output from command python setup.py egg_info: 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "/tmp/pip-build-YkvqVh/json/setup.py", line 2, in <module> 
     raise RuntimeError("Package 'json' must not be downloaded from pypi") 
    RuntimeError: Package 'json' must not be downloaded from pypi 

    ---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-YkvqVh/json/ 
+2

? –

+8

これは起こっている場合は、 "パッケージは不要です"と言うべきです。私がパッケージをインストールする必要があり、インストーラがXからダウンロードできないと言われたら、合理的な前提はどこからでもダウンロードする必要があるということです。しかしここで? –

答えて

40

jsonビルトインモジュールである、あなたはpipでそれをインストールする必要はありません。

+1

これは正しいです。私は投稿する前にそれをチェックしていない、ごめんなさい。 「python import json」で二重チェックを行っても機能します! – user4330326

-6

代わりにsimplejsonをインストールできます。 `はRuntimeError( "パッケージ 'JSON' は、PyPIからダウンロードしてはいけません")を上げる`については明らかではない何

pip install simplejson

関連する問題