Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error loading Trelby.py
#1
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?
Reply
#2
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.
Reply
#3
(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?
Reply
#4
Update,

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Error loading location on openweathermap via API with Kivy Gigux 10 5,582 Apr-24-2019, 06:08 PM
Last Post: Yoriz
  Getting error while loading excel(.xlsx) file using openpyxl module shubhamjainj 1 8,991 Mar-01-2019, 01:05 PM
Last Post: buran
  error creating new object after loading pickled objects from file arogers 2 3,460 Feb-02-2019, 10:43 AM
Last Post: Larz60+
  PyQt5 No Error But GUI Window Not Loading digitalmatic7 1 4,247 Nov-21-2017, 05:23 PM
Last Post: digitalmatic7
  Error while loading the csv file Analyst 3 10,249 Oct-18-2017, 07:07 AM
Last Post: Analyst

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020