LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-18-2020, 09:03 PM   #1
TheJooomes
Member
 
Registered: May 2019
Posts: 189

Rep: Reputation: Disabled
Green-Recorder "SyntaxError: invalid syntax" when executing the binary, python 2.7, Fedora 32


I get this output when executing the green-recorder binary
Code:
[james@localhost green-recorder-master]$ ./green-recorder 
  File "./green-recorder", line 74
    print "You are recording on: " + str(DisplayServer)
          ^
SyntaxError: invalid syntax
So my first thought was there's a syntax error 'cause it says it right there. I don't know python at all so I'd have no hope of fixing it myself, and I can't find any complaints about it with the project so it's probably correct and something else is the problem.

This isn't a big priority for me so I ain't gonna spend days figuring out python, I'm hoping someone with time to burn who does know python can help me out with this, if not, eh.

Oh yea, I do have the python27 package installed for python 2 support.
 
Old 05-18-2020, 10:16 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by TheJooomes View Post
Oh yea, I do have the python27 package installed for python 2 support.
It looks like green-recorder is written in Python2, but the interpreter you use is Python3. In Python3, print is a regular function and requires parentheses.

You installed Python2, but I guess you are still using Python 3 as the default interpreter. Right now, I see two options:
  • modify green-recorder to use Python2. You do this by writing the path to the Python2 executable after a "#!" (known as "hash-bang") in the first line of the program.
  • Create a symbolic link from Python2 to /usr/bin/python. You need to be aware that this affects all other Python programs. It's probably not the best solution.
 
Old 05-18-2020, 11:07 PM   #3
TheJooomes
Member
 
Registered: May 2019
Posts: 189

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
It looks like green-recorder is written in Python2, but the interpreter you use is Python3. In Python3, print is a regular function and requires parentheses.

You installed Python2, but I guess you are still using Python 3 as the default interpreter. Right now, I see two options:
  • modify green-recorder to use Python2. You do this by writing the path to the Python2 executable after a "#!" (known as "hash-bang") in the first line of the program.
  • Create a symbolic link from Python2 to /usr/bin/python. You need to be aware that this affects all other Python programs. It's probably not the best solution.
The current "hash-bang" is #!/usr/bin/python, I changed that to #!/usr/bin/python2.7 after making sure that /usr/bin/python2.7 exists. (I also tried #!/usr/bin/python2, same results)

This time I'm getting
Code:
[james@localhost green-recorder-master]$ ./green-recorder 
Traceback (most recent call last):
  File "./green-recorder", line 17, in <module>
    import gi
ImportError: No module named gi
What I can figure out from that gi error is the gi module is missing. A little looking up and I think it's related to pygobject2, I found it in the repos and installed it, green recorder still won't launch. A whereis couldn't find pygobject2, pygobject, gobject, or gi, so I'm not really sure what the binaries for it are named but I'm pretty sure it installed correctly.
 
Old 05-19-2020, 01:15 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Not sure if you consider that progress

Modules are usually stored somewhere under /usr/lib/pythonXYZ. Check around there.
 
Old 05-19-2020, 02:56 AM   #5
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
The package python2-gobject was dropped from Fedora 32. From the changelog:
Quote:
2020-01-16 - Miro Hrončok <mhroncok@redhat.com> - 3.34.0-4
- Subpackages python2-gobject, python2-gobject-base, python2-gobject-devel have been removed
See https://fedoraproject.org/wiki/Changes/RetirePython2
Your options are:
  • install via pip2 from PyPI
  • rebuild from Fedora 31 source
The same applies to python2-pydbus which is also required by Green Recorder.

But the best option, IMO, would be to find another screen recording application. From Green Recorder's README:
Quote:
This project is archived, it's no longer under development. As the original developer, the work of maintaining and updating this program takes too much of my time, which I was giving for free, and I am no longer interested in working with things like ffmpeg/wayland/GNOME's screencaster or solving the issues related to them or why they don't work. If you would like to continue development, please feel free to fork the project according to the GPL license.

Last edited by shruggy; 05-19-2020 at 03:01 AM.
 
Old 05-20-2020, 01:53 PM   #6
TheJooomes
Member
 
Registered: May 2019
Posts: 189

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
But the best option, IMO, would be to find another screen recording application.
I would love to find another screen recorder application that's full native Wayland. The closed I could find is OBS with it's X11/Wayland plug-in, but OBS locks up when I give it permission to view my screen. I'm open to suggestions, I was contemplating between making a thread to see if I could fix Green Recorder and making a thread to look for Wayland screen recorders. My last thread about Wayland didn't do so well so I decided to make this one.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SyntaxError: Invalid Syntax NewSheriff Linux - Newbie 3 02-19-2018 06:51 PM
LXer: Green Recorder – A Simple Screen Recorder For Linux With Wayland Support LXer Syndicated Linux News 0 09-08-2017 01:37 PM
LXer: Linux Desktop Recorder App Green Recorder 3.0 Released LXer Syndicated Linux News 0 08-08-2017 04:55 PM
[SOLVED] Python Newbie: SyntaxError: invalid syntax gdizzle Programming 1 07-08-2014 07:44 PM
GREEN, Green, green... pmartiz LinuxQuestions.org Member Intro 1 06-12-2003 11:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration