Search code examples
pythondjangopython-3.xcookiecutter-djangocookiecutter

Fresh cookiecutter django project shows "Invalid syntax" at environ.py


I started my first project with cookiecutter using the cookiecutter-django template.

When I tried to start it from PyCharm using the virtualenv, it gave me an error in a lib file: environ.py, telling me this:

  File "/home/madtyn/venvs/nana/lib/python3.6/site-packages/environ.py", line 114
    raise ValueError, "No frame marked with %s." % fname
                    ^
SyntaxError: invalid syntax

After searching, I consulted somebody and I was recommended another way. I tried, as they told me, to make a new venv,

python3 -m venv /home/madtyn/venvs/name

activate it

source /home/madtyn/venvs/name/bin/activate

and run the server from command line but the same thing seems to happen.

I don't think I did anything wrong. These are my specifications:

  • Kubuntu (64bit arch)
  • Python 3.6.8 (both the venv and the main one)
  • cookiecutter 1.6.0 (installed through pip3)
  • PyCharm 2019.2.2

Solution

  • You should install the Python dependencies after having activated your virtual environment:

    pip install -r requirements/local.txt