2017-01-04 12 views
14

Nie można zainstalować modułu json. O ile wiem, nie powinienem używać sudo. o co chodzi?"instalacja pip json" kończy się niepowodzeniem w systemie 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

Co nie jest jasne, o 'podnieść RuntimeError ("pakiet 'json' nie musi być pobrany z PyPI")'? –

+8

Należy powiedzieć coś w stylu "pakiet jest niepotrzebny", jeśli tak się dzieje. Jeśli powiedziano mi, że muszę zainstalować pakiet, a instalator mówi, że nie mogę pobrać go z X, rozsądnym założeniem jest to, że muszę go pobrać z innego miejsca. Ale gdzie? –

Odpowiedz

40

json jest wbudowany moduł, nie trzeba go zainstalować z pip.

+1

Zgadza się. Nie sprawdziłem tego przed wysłaniem, przepraszam. Podwójne sprawdzenie z "python import json" i to działa! – user4330326

-6

Zamiast tego można zainstalować simplejson.

pip install simplejson

Powiązane problemy