使用pip更新os模块会导致错误

时间:2017-09-20 15:36:23

标签: python python-3.x

C:\Users\Personal>pip install --upgrade os
Collecting os
  Using cached os-0.5.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\personal\appdata\local\programs\python\python36\lib\tokenize.py", line 452, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Personal\\AppData\\Local\\Temp\\pip-build-hlmmdd48\\os\\setup.py'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Personal\AppData\Local\Temp\pip-build-hlmmdd48\os\

1 个答案:

答案 0 :(得分:2)

os模块是Pythons标准库的一部分,如果你得到更新版本的Python,你可以“更新”它。

你是trying to download似乎是一个虚拟的os模块,其setupy.py中包含一行说明:

raise RuntimeError("Package 'os' must not be downloaded from pypi")

那是因为你没有下载也没有更新它;它默认在Python中可用。