我已经安装了Django 1.4.3。然后,当我使用pip升级Django时,我收到了这个错误。
$ pip install Django --upgrade
Downloading/unpacking Django from https://pypi.python.org/packages/source/D/Django/Django-1.5.2.tar.gz#md5=26e83e6394a15a86212777d5f61eae86
Running setup.py egg_info for package Django
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
Installing collected packages: Django
Found existing installation: Django 1.4.3
Uninstalling Django:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/install.py", line 271, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1181, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 495, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1518, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/util.py", line 293, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 296, in move
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 249, in rmtree
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 247, in rmtree
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/Django-1.4.3-py2.7.egg-info/dependency_links.txt'
当我试图卸载Django 1.4.3时,
$ pip uninstall django
我遇到了类似的错误。
当我安装Django 1.4.3时,我没有下载它。我只是使用了pip而且它有效。 然后我下载了Django 1.5.2并尝试升级,但它没有用。
这可能是个愚蠢的问题:为什么我不需要下载Django 1.4.3来安装它? 而且我也无法弄清楚这个错误意味着什么。
在下载和安装方面,我总是很困惑。 我不完全了解终端的情况。
感谢任何帮助。