python-2.7 - "pip install json"在 Ubuntu 上失败

标签 python-2.7 pip ubuntu-16.04

无法安装 json 模块。
据我所知,我不应该使用 sudo。怎么了?

 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/

最佳答案

json 是一个内置模块,你不需要用pip安装它.

关于python-2.7 - "pip install json"在 Ubuntu 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41466431/

相关文章:

linux - 终端和 SSH session 之间的区别

python - 修改列表中的元组

python - Boto3查找未使用的安全组

python - 有没有办法为基于平台的 Python 应用程序提供条件 requirements.txt 文件?

python - Mac OS X 无法再使用 pip 安装软件包

laravel - 如何在 PhpStorm 2018.1 中创建新的 Laravel 项目?

python - 为什么在 python 中从列表中创建一个 freezeset 会转换列表?

python - Twisted:目录中新文件的事件

git - Pip 无法再从 https 克隆 - 错误 128

c# - 如何在 Linux 上运行 .NET Core 控制台应用程序