topisani/Discurses

Can't start Discurses: Syntax error

Closed this issue · 13 comments

k4lim commented

Hi, when I try to start discurses I'm getting the following error:

bildschirmfoto 2018-08-03 um 10 01 31

I'm on macOS High Sierra V 10.13.6

Ge0 commented

Hi! What Discurse version are you using?

k4lim commented

It's Version 0.3.4

k4lim commented

I don't really know what I changed in the last hour, but now I get this error:

bildschirmfoto 2018-08-03 um 11 23 30

inftp commented

This seems to be related to Rapptz/discord.py#1421

I am also getting this error. I'm on a Lenovo T61 with Manjaro (Arch, basically) with Python 3.7.1

My error is occurring in compat.py at line 32.

Full log:

Traceback (most recent call last):
  File "/usr/bin/discurses", line 11, in <module>
    load_entry_point('discurses==0.3.4', 'console_scripts', 'discurses')()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 487, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2728, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2346, in load
    return self.resolve()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2352, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.7/site-packages/discurses/__main__.py", line 1, in <module>
    from . import discord
  File "/usr/lib/python3.7/site-packages/discurses/discord.py", line 6, in <module>
    import discord
  File "/usr/lib/python3.7/site-packages/discord/__init__.py", line 20, in <module>
    from .client import Client, AppInfo, ChannelPermissions
  File "/usr/lib/python3.7/site-packages/discord/client.py", line 38, in <module>
    from .state import ConnectionState
  File "/usr/lib/python3.7/site-packages/discord/state.py", line 36, in <module>
    from . import utils, compat
  File "/usr/lib/python3.7/site-packages/discord/compat.py", line 32
    create_task = asyncio.async
                              ^
SyntaxError: invalid syntax

Hi you're getting this error because you're running py3.7.
discord.py does not support this version. There is a rewrite for it to support 3.7 in the works but it does not work with Discurses it seems (changes the way Channels are handled it seems)

This error is caused by async becoming a reserved keyword.

I am getting the same error, is there a solution yet?
Maybe, is there some way to specify which version of python is handling discurses?

You could look at pyenv I got it working with that. More extremely something like docker could be used I guess?

Use python2 then, as python can be either version
image
Version specific programs should always use the static name

Docker would work but I wouldn't package it like that officially, docker still requires the Pro version of Windows 10 to run which is quite expensive, setting some kind of env or executable name should work.

Ge0 commented

Hey guys,

sorry for not being quite active on that issue.

The error has nothing to do with Discurses. It is related to discord.py which does not fit to Python 3.7+ as you can see.

You can just use pyenv to manage multiple python versions, create a virtual environment for discurses with Python 3.6 and make it run.

In between, I wonder if it would be relevant to forbid 3.7 in the setup.py file…

It might be worth at least mentioning this issue in the install instructions for now?

Although pyenv or uninstalling python3 would fix the problem, and the problem being with discord.py not discurses, the solution lies with the individual program, you have to specify the versions in your program and use the python2 executable instead of python as python can be either 2 or 3.
Or you can update the depended version of discord.py to the branch that works with the latest version of python3.

The discord.py branch that works with python 3.7 breaks the way this program handles channels giving this error

I don't really know what I changed in the last hour, but now I get this error:

bildschirmfoto 2018-08-03 um 11 23 30

It needs to be used with 3.6 or below for it to work hence the suggestion of pyenv. Not everyone has python 3 and 2 installed anyway, and this program does work with python 3.6