Python pip已停止正常工作

时间:2016-03-22 09:34:34

标签: python-3.x pip

Pip已经在我的机器上工作了一段时间,我已经用它来安装了很多库。但是今天当我试图用它来安装pymssql时我得到一个错误......

'pip' is not recognized as an internal or external command,

...所以我查看我的路径...

C:\Python33>echo %PATH%
C:\Program Files (x86)\PC Connectivity Solution\;C:\Python33\;C:\Python33\tcl\tcl8.5;C:\Python33\tcl\tk8.5;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Lenovo\Bluetooth Software\;C:\Program Files\Lenovo\Bluetooth Software\syswow64;C:\Program Files (x86)\Calibre2\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Skype\Phone\;C:\PythonScripts\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Adobe\AGL;C:\Python33\Scripts;C:\Program Files\Bandizip\7z

...和C:\ Python33 \ Scripts就在那里。所以我尝试升级它......

C:\Python33>python -m pip install --upgrade pip
C:\Python33\python.exe: cannot import name pkg_resources; 'pip' is a package and cannot be directly executed

...也许如果我再试一次......

C:\Python33>python get-pip.py
You are using pip version 7.0.3, however version 8.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Collecting pip
  Using cached pip-8.1.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 8.0.2
    Uninstalling pip-8.0.2:
      Successfully uninstalled pip-8.0.2
  Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
  File "c:\users\lenovo\appdata\local\temp\tmpb94wxh\pip.zip\pip\basecommand.py", line 223, in main
    status = self.run(options, args)
  File "c:\users\lenovo\appdata\local\temp\tmpb94wxh\pip.zip\pip\commands\install.py", line 297, in run
    root=options.root_path,
  File "c:\users\lenovo\appdata\local\temp\tmpb94wxh\pip.zip\pip\req\req_set.py", line 622, in install
    **kwargs
  File "c:\users\lenovo\appdata\local\temp\tmpb94wxh\pip.zip\pip\req\req_install.py", line 808, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "c:\users\lenovo\appdata\local\temp\tmpb94wxh\pip.zip\pip\req\req_install.py", line 1003, in move_wheel_files
    isolated=self.isolated,
  File "c:\users\lenovo\appdata\local\temp\tmpb94wxh\pip.zip\pip\wheel.py", line 339, in move_wheel_files
    clobber(source, lib_dir, True)
  File "c:\users\lenovo\appdata\local\temp\tmpb94wxh\pip.zip\pip\wheel.py", line 310, in clobber
    ensure_dir(destdir)
  File "c:\users\lenovo\appdata\local\temp\tmpb94wxh\pip.zip\pip\utils\__init__.py", line 70, in ensure_dir
    os.makedirs(path)
  File "C:\Python33\lib\os.py", line 269, in makedirs
    mkdir(name, mode)
PermissionError: [WinError 5] Access is denied: 'C:\\Python33\\Lib\\site-packages\\pip\\_vendor\\cachecontrol'

我尝试删除pip,以便重新安装它。

C:\Python33>pip uninstall pip
'pip' is not recognized as an internal or external command,
operable program or batch file.

现在我被困在想法上了。有没有办法去除pip或修复它?为什么我会收到这些错误?为什么会突然停止工作?

0 个答案:

没有答案