我在Windows 7机器上安装了Python 3.5,并且点了8.1.1。
每次我这样做:pip install django
我得到一个类似的例外:
(myproject) C:\Users\meyer>pip3 install django
Collecting django
Using cached Django-1.9.5-py2.py3-none-any.whl
Exception:
Traceback (most recent call last):
File "c:\users\meyer\envs\myproject\lib\shutil.py", line 381, in _rmtree_unsae
os.unlink(fullname)
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\Users\\meyer\\AppData\\Local\\Temp\\pip-4o7_2c66-unpack\\Django-1.9.5-py2.py3-nne-any.whl'
在处理上述异常期间,发生了另一个异常:
Traceback (most recent call last):
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\basecommand.py", line 209, in main status = self.run(options, args)
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\commands\install.py, line 310, in run wb.build(autobuilding=True)
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\wheel.py", line 748 in build self.requirement_set.prepare_files(self.finder)
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\req\req_set.py", line 360, in prepare_files ignore_dependencies=self.ignore_dependencies))
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\req\req_set.py", line 577, in _prepare_file session=self.session, hashes=hashes)
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\download.py", line 10, in unpack_url hashes=hashes
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\download.py", line 61, in unpack_http_url rmtree(temp_dir)
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\_vendor\retrying.py, line 49, in wrapped_f return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\_vendor\retrying.py, line 212, in call raise attempt.get()
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\_vendor\retrying.py, line 247, in get six.reraise(self.value[0], self.value[1], self.value[2])
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\_vendor\six.py", line 686, in reraise raise value
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\_vendor\retrying.py, line 200, in call attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "c:\users\meyer\envs\myproject\lib\site-packages\pip\utils\__init__.py", line 102, in rmtree onerror=rmtree_errorhandler)
File "c:\users\meyer\envs\myproject\lib\shutil.py", line 488, in rmtree return _rmtree_unsafe(path, onerror)
File "c:\users\meyer\envs\myproject\lib\shutil.py", line 383, in rmtree_unsa
任何想法我做错了什么?我认为这一定是pip 8.1.1中的一个错误,因为我在另一台Windows机器上有pip 7.1.2并且安装了django就好了。