0

Fresh installation of Zulip on new Server. Installation went well and everything.

I want to use manage.py to do some things, but when I run something like

su zulip ./manage.py shell

But I get this error message:

./manage.py: line 2: syntax error near unexpected token `('
./manage.py: line 2: `from __future__ import (print_function)'

Does anyone have a idea what's wrong? Thanks in advance!

Anders Kaseorg
  • 3,657
  • 22
  • 35
fehmelchen
  • 203
  • 3
  • 15
  • That looks like a shell is trying to execute `manage.py`, rather that the Python interpreter. Does that file still start with the shebang line (`#!/usr/bin/env python3`)? You could try explicitly running it as `python3 manage.py shell`. – jasonharper Nov 27 '19 at 14:17
  • @jasonharper thanks, that was my idea as well, but the line is there. When i try to execute it explicitly this comes up: /usr/bin/python3: /usr/bin/python3: cannot execute binary file – fehmelchen Nov 28 '19 at 12:18
  • It's this file: https://github.com/zulip/zulip/blob/master/manage.py – fehmelchen Nov 28 '19 at 12:33

1 Answers1

0

This is an incorrect usage of su; it caused su to launch bash ./manage.py shell, which tried to interpret manage.py as a Bash script. You meant one of these:

su zulip -c './manage.py shell'
sudo -u zulip ./manage.py shell
Anders Kaseorg
  • 3,657
  • 22
  • 35