我手动将操作符替换为<>
,!=
然后pip install django-toolbelt
再次运行。然后另一个 static.py 文件出现了同样的错误:
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...
然后我在那个 static.py 文件中再次<>
更改了运算符。!=
然后又跑pip install django-toolbelt
了。现在没有显示错误:
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...
好像没问题。需要为 Python 3.2 更新 static.py 文件。