Python Forum
Error loading Trelby.py - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Error loading Trelby.py (/thread-31813.html)



Error loading Trelby.py - blackclover - Jan-05-2021

Hi,

I'm trying to run Trelby on Void Linux.
When I run the program from the terminal, I get the following error:

$ trelby
Traceback (most recent call last):
File "/bin/trelby", line 8, in <module>
import trelby
File "/usr/share/trelby//src/trelby.py", line 123
os.mkdir(misc.toPath(misc.confPath), 0755)
^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers

The Python version is python-2.7.18_2.x86_64-musl
I know nothing about Python but assume I need to edit the /usr/share/trelby//src/trelby.py somehow.
Any suggestions?


RE: Error loading Trelby.py - bowlofred - Jan-05-2021

Hmm. I don't think you should see that error on 2.7. Perhaps you are invoking a different python version?

But that error is expected on python3. Just change the 0755 to 0o755 and it should work on both python2 or python3.


RE: Error loading Trelby.py - blackclover - Jan-05-2021

(Jan-05-2021, 03:47 AM)bowlofred Wrote: Hmm. I don't think you should see that error on 2.7. Perhaps you are invoking a different python version?

But that error is expected on python3. Just change the 0755 to 0o755 and it should work on both python2 or python3.

Thanks a lot!
That worked, though now I get another error:

$trelby
Traceback (most recent call last):
File "/usr/local/bin/trelby", line 8, in <module>
import trelby
File "/usr/share/trelby//src/trelby.py", line 1320
print "%.5f seconds per %s" % (t / count, name)
^
SyntaxError: invalid syntax

I have both Python 2.7 and Python3 installed, is it possible Trelby is using the wrong version?


RE: Error loading Trelby.py - blackclover - Jan-05-2021

Update,

I was able to fix the problem by uninstalling python3 and the reinstalling Trelby.