dsnopek / anki-sync-server

A personal Anki sync server (so you can sync against your own server rather than AnkiWeb)
GNU Affero General Public License v3.0
744 stars 95 forks source link

ankiserverctl.py adduser admin FAIL. Missing parentheses in call to 'print'. #82

Open nobicycle opened 5 years ago

nobicycle commented 5 years ago

Thank you for anki-sync-server The following fails with error " Missing parentheses in call to 'print'."

ankiserverctl.py adduser admin

Best wishes

Output

(Anki-Server) [me@tower Anki-Server]$ ankiserverctl.py adduser admin File "/home/me/Development/Python/Anki-Server/bin/ankiserverctl.py", line 18 print "usage: "+sys.argv[0]+" []" ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("usage: "+sys.argv[0]+" []")? (Anki-Server) [me@tower Anki-Server]$ ls production.ini production.ini

production.ini is an unchanged copy of example.ini

Environment

Python 3.7.2 $ uname -a Linux tower 4.19.28-1-MANJARO #1 SMP PREEMPT Sun Mar 10 08:32:42 UTC 2019 x86_64 GNU/Linux

E-R-C commented 5 years ago

I'm not involved with this project at all, but this sounds like the issue you're having is that you're installing on Python 3 and it needs to be installed on python 2. Try to install an environment of python 2 and try installing via pip2.

Assuming you're on a debian linux system, a quick google search gives a good starting point (look at the accepted answer) here.

Print statements from python 2 didn't use parenthesis and that's probably why you're getting the error here.

nobicycle commented 5 years ago

Thanks. Pip install fixed it.

nobicycle commented 5 years ago

Hi, I am getting the error mentioned above again. Im using a virtualenv and python3.7

2019-06-11 05:18:17 [INFO] Creating ankiserver virtual environment in /home/me/Development/Python ...
Using base prefix '/usr'
New python executable in /home/me/Development/Python/ankiserver/bin/python
Installing setuptools, pip, wheel...
done.
Collecting AnkiServer
Collecting PasteScript>=1.7.3 (from AnkiServer)
  Using cached https://files.pythonhosted.org/packages/47/4f/a3e6a848328b2540e73e12a96c17c72637175661470cb852efa2eb9187e3/PasteScript-3.1.0-py2.py3-none-any.whl
Collecting PasteDeploy>=1.3.2 (from AnkiServer)
  Using cached https://files.pythonhosted.org/packages/67/0c/faa9971b2e5e048b3b30008d04c72e4d5f63b42f48937c169acce2c5e70a/PasteDeploy-2.0.1-py2.py3-none-any.whl
Collecting SQLAlchemy>=0.6.3 (from AnkiServer)
Collecting WebOb>=0.9.7 (from AnkiServer)
  Using cached https://files.pythonhosted.org/packages/06/e1/4acd2b4327fceb4c6446bdbca515f807ab83188526fd654940c00bcf8cc3/WebOb-1.8.5-py2.py3-none-any.whl
Collecting Paste>=3.0 (from PasteScript>=1.7.3->AnkiServer)
  Using cached https://files.pythonhosted.org/packages/fc/8e/287533a1515f2e9eaf34be06f35e8f170d0cb625a2ada2c5e41c0b9ae1e5/Paste-3.0.8-py2.py3-none-any.whl
Collecting six (from PasteScript>=1.7.3->AnkiServer)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, Paste, PasteDeploy, PasteScript, SQLAlchemy, WebOb, AnkiServer
Successfully installed AnkiServer-2.0.6 Paste-3.0.8 PasteDeploy-2.0.1 PasteScript-3.1.0 SQLAlchemy-1.3.4 WebOb-1.8.5 six-1.12.0

ankiserver) [me@tower ankiserver]$ ./bin/ankiserverctl.py start 
  File "./bin/ankiserverctl.py", line 18
    print "usage: "+sys.argv[0]+" <command> [<args>]"
                  ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("usage: "+sys.argv[0]+" <command> [<args>]")?
(ankiserver) [me@tower ankiserver]$ python -V
Python 3.7.3