0

I can't get the ocdev tool to run. when I try running it i receive "SyntaxError: invalid syntax" with some code. My guess is maybe wrong python version? Since python --version outputs 2.7.3. I also have python3 installed but it's not the standard version. I installed ocdev using pip-3.2. I already tried reinstalling it multiple times. I also have python3-jinja2 installed. I'm running debian 7.8.

Here is the whole error:

Traceback (most recent call last): File "/usr/local/bin/ocdev", line 9, in <module> load_entry_point('ocdev==0.1.2', 'console_scripts', 'ocdev')() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 337, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2280, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1990, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/usr/local/lib/python3.2/dist-packages/ocdev/application.py", line 20, in <module> from ocdev.plugins import PLUGINS File "/usr/local/lib/python3.2/dist-packages/ocdev/plugins/__init__.py", line 1, in <module> from ocdev.plugins.startapp.startapp import StartApp File "/usr/local/lib/python3.2/dist-packages/ocdev/plugins/startapp/startapp.py", line 7, in <module> from jinja2 import Environment, FileSystemLoader File "/usr/local/lib/python3.2/dist-packages/jinja2/__init__.py", line 33, in <module> from jinja2.environment import Environment, Template File "/usr/local/lib/python3.2/dist-packages/jinja2/environment.py", line 639 u'\xff\xff\xff\xff'.encode('iso-8859-15') ^ SyntaxError: invalid syntax

2 Answers 2

1

In order to get ocdev to work with Python 3.2 you need to install legacy versions of Jinja2(source) and MarkupSafe(source). This is because the newer versions require Python 3.3.

To do the proper install follow the regular setup guide and use the following pip/pip3 commands:

pip install -Iv Jinja2==2.6
pip install -Iv MarkupSafe==0.15
pip install ocdev

I also reported this in the ocdev GitHub repository here.

Sign up to request clarification or add additional context in comments.

Comments

0

It looks like you're running Python 3.2.

To use the u'unicode' syntax with Python 3 you'll need at least Python 3.3. (see What's New In Python 3.3)

1 Comment

If the answer was helpful you can mark my answer as accepted. It will give me more reputation score and the motivation to answer other questions.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.