3

I am deploying my site to heroku. After successfully creating a virtualenv, I ran into a problem when installing django-toolbelt using "pip install django-toolbelt" in this virtualenv.

At first, everything is fine, until:

  Running setup.py install for static
      File "/home/administrator/env2/env2_env/lib/python3.2/site-packages/static.py", line 104
        if full_path[-1] <> '/' or full_path == self.root:
                          ^
    SyntaxError: invalid syntax


    Installing static script to /home/administrator/env2/env2_env/bin
Successfully installed django-toolbelt django psycopg2 gunicorn dj-database-url dj-static static
Cleaning up...

I know the cause of the error is the comparison operator <> is invalid in python3.2. What I concern about is whether the installation succeed or not although the display on screen is "successfully installed django-toolbelt ...".
If not, what can I do to fix this issue? Thanks.

Maxime Lorant
  • 34,607
  • 19
  • 87
  • 97
Yang Wenhao
  • 544
  • 1
  • 4
  • 15
  • Please accept the answer to mark your question as resolved (it's a community wiki post, I'll not gain any reputation, don't worry :) ) – Maxime Lorant Feb 28 '14 at 21:42

1 Answers1

0

I manually replaced the operator <> with !=, and ran pip install django-toolbelt once more. Then same error appeared with another static.py file:

  Running setup.py install for static
      File "/usr/local/lib/python3.2/site-packages/static.py", line 104
        if full_path[-1] <> '/' or full_path == self.root:
                          ^
    SyntaxError: invalid syntax


    Installing static script to /usr/local/bin
Successfully installed django-toolbelt gunicorn dj-database-url dj-static static
Cleaning up...

Then I changed the operator <> with != again in that static.py file. Then ran pip install django-toolbelt again. Now there is no error displayed:

Requirement already satisfied (use --upgrade to upgrade): django-toolbelt in /usr/local/lib/python3.2/site-packages
Requirement already satisfied (use --upgrade to upgrade): django in /usr/local/lib/python3.2/site-packages (from django-toolbelt)
Requirement already satisfied (use --upgrade to upgrade): psycopg2 in /usr/local/lib/python3.2/site-packages (from django-toolbelt)
Requirement already satisfied (use --upgrade to upgrade): gunicorn in /usr/local/lib/python3.2/site-packages (from django-toolbelt)
Requirement already satisfied (use --upgrade to upgrade): dj-database-url in /usr/local/lib/python3.2/site-packages (from django-toolbelt)
Requirement already satisfied (use --upgrade to upgrade): dj-static in /usr/local/lib/python3.2/site-packages (from django-toolbelt)
Requirement already satisfied (use --upgrade to upgrade): static in /usr/local/lib/python3.2/site-packages (from dj-static->django-toolbelt)
Requirement already satisfied (use --upgrade to upgrade): wsgiref in /usr/local/lib/python3.2 (from static->dj-static->django-toolbelt)
Cleaning up...

It seems OK. The static.py file is needed to update for Python 3.2.

Maxime Lorant
  • 34,607
  • 19
  • 87
  • 97