0

I already installed Django 1.4.3. Then when I used pip to upgrade Django, I got this error.

$ 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'

When I tried to just uninstall Django 1.4.3,

$ pip uninstall django

I got a similar error.

When I installed Django 1.4.3, I did not download it. I just used pip and it worked. Then I downloaded Django 1.5.2 and tried to upgrade but it did not work.

This may be silly question: Why did I not need to download Django 1.4.3 to install it? And also I cannot figure out what this error means.

I am always confused when it comes to downloading and installing. I do not fully understand what is going on in terminal.

Any help is appreciated.

Kenzo
  • 61
  • 2
  • 8
  • 3
    You need root permission to install globally. Try `sudo pip install Django --upgrade`. – falsetru Aug 14 '13 at 02:23
  • Thanks! It said 'Successfully installed Django' But when I looked at the version, it is still 1.4.3. Why? – Kenzo Aug 14 '13 at 02:45
  • You might need to clear pip's "cache" also: http://stackoverflow.com/questions/9510474/removing-pips-cache – Derek Kwok Aug 14 '13 at 02:59
  • I upgraded pip and did `sudo pip install django==1.5.2 --ignore-installed` It worked! Thank you so much! – Kenzo Aug 14 '13 at 03:17
  • Thank you your comment, Udacian & Derek Kwok, finally I can upgrade to django 1.5.2 successfully sudo pip install django==1.5.2 --ignore-installed – Romans 8.38-39 Aug 15 '13 at 03:02

0 Answers0