1

I'm trying to install Django via pip, with

pip install Django==1.5.5

but I get the error:

File "django\utils\version.py", line 1
from __future__ import unicode_literals
SyntaxError: future feature unicode_literals is not defined

My guess is this is because pip is using the Python 2.5 version of pip. I have installed pip into Python 2.7, and have a directory structure that looks like this:

C:\Python27\Lib\site-packages\pip

Question: I know I can install Django from the .tar, but I would like pip to work so that other Python 2.7 projects can use the (much simpler) pip. What do I need to change in order for this to work?

Chelonian
  • 549
  • 2
  • 5
  • 21
  • Have you tried using easy_install? Also, are you using a virtual env? – KGo Nov 05 '13 at 05:35
  • 1
    Looking into setting up virtualenv & virtualenvwrapper-win. – cryptojuice Nov 05 '13 at 05:58
  • [This answer](http://stackoverflow.com/a/5226504/2689986) & [this question](http://stackoverflow.com/questions/13472942/make-pip-install-package-for-specific-python-installation?rq=1) may help. – shad0w_wa1k3r Nov 05 '13 at 06:31

1 Answers1

3

Since your path is C:\Python27\Lib\site-packages\pip, I guess you're on Windows. Then which pip is invoked is controlled primarily by %PATH% system environment. Running echo %PATH% to find out which pip directory is listed first and changing variable appropriately should help. Normally, the directory you need to be searched first should be C:\Python27\Scripts, that is where pip.exe is located.

alko
  • 46,136
  • 12
  • 94
  • 102
  • 1
    Thanks. When I was looking for pip, I was looking for pip in C:\Python27\Lib\site-packages\pip for some reason. What worked for me was to do: C:\Python27\Scripts\pip.exe install django==1.6 – Chelonian Nov 06 '13 at 21:37