PlexConnect icon indicating copy to clipboard operation
PlexConnect copied to clipboard

Python error on Fedora 31

Open mzigaib opened this issue 6 years ago • 13 comments

I am getting this error when running PlexConnect.py:

Traceback (most recent call last): File "./PlexConnect.py", line 20, in import DNSServer, WebServer File "/home/mzigaib/Downloads/PlexConnect/DNSServer.py", line 116 print "ID {0:04x}".format((ord(paket[0])<<8)+ord(paket[1])) ^ SyntaxError: invalid syntax

mzigaib avatar Sep 18 '20 16:09 mzigaib

Log please.

moodyblue avatar Sep 18 '20 18:09 moodyblue

Likely that your environment is set up with Python 3 rather than Python 2.7, Even though Python 2 is EOL, PlexConnect was never migrated to 3.

grandexperiments avatar Sep 18 '20 20:09 grandexperiments

Oh bummer! Is there any plans to migrate?

Em sex., 18 de set. de 2020 às 17:30, Grand Experiments < [email protected]> escreveu:

Likely that your environment is set up with Python 3 rather than Python 2.7, Even though Python 2 is EOL, PlexConnect was never migrated to 3.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/iBaa/PlexConnect/issues/587#issuecomment-695071332, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQPDENUBKFISDXLAHEWYM3SGO7NTANCNFSM4RSGGIXA .

--

Michel Martins Zigaib

Visual Effects Technical Director [email protected] [email protected]

mzigaib avatar Sep 18 '20 22:09 mzigaib

I did a " alias python='/usr/bin/python2.7' " So my python -V is now "Python 2.7.18" and the error was the same, can you help me?

mzigaib avatar Sep 18 '20 23:09 mzigaib

There are no plans to migrate PlexConnect to Python 3.

Pls post PlexConnect.log

moodyblue avatar Sep 19 '20 08:09 moodyblue

Since the Python syntax error is occurring at a "print" statement, I can almost guarantee the issue is Python 3.

As moody says, post your log file. Also, tell us how you're instantiating PlexConnect at boot-up.

grandexperiments avatar Sep 19 '20 17:09 grandexperiments

I did initialize a environment for python 2.7.18 but I still get this error and no logs:

Sep 19,2020 22:32:27 PlexConnect: *** Sep 19,2020 22:32:27 PlexConnect: PlexConnect Sep 19,2020 22:32:27 PlexConnect: Press CTRL-C to shut down. Sep 19,2020 22:32:27 PlexConnect: *** Traceback (most recent call last): File "./PlexConnect.py", line 198, in running = startup() File "./PlexConnect.py", line 65, in startup cfg = Settings.CSettings(CONFIG_PATH) File "/home/mzigaib/Downloads/PlexConnect/Settings.py", line 72, in init self.loadSettings() File "/home/mzigaib/Downloads/PlexConnect/Settings.py", line 80, in loadSettings self.cfg.read(self.getSettingsFile()) File "/usr/lib64/python2.7/ConfigParser.py", line 305, in read self._read(fp, filename) File "/usr/lib64/python2.7/ConfigParser.py", line 512, in _read raise MissingSectionHeaderError(fpname, lineno, line) ConfigParser.MissingSectionHeaderError: File contains no section headers. file: /home/mzigaib/Downloads/PlexConnect/./Settings.cfg, line: 1 'enable_dnsserver = False\n'

mzigaib avatar Sep 20 '20 01:09 mzigaib

For sure is something related to Fedora because on Mint is working fine.

mzigaib avatar Sep 20 '20 02:09 mzigaib

enable_dnsserver = False\n is not a valid statement in Settings.cfg, The correct statement would be enable_dnsserver = False

If you are disabling PlexConnect's dns server you need to use another dns server (or dnsmasq) to manage dns calls from the atv.

moodyblue avatar Sep 20 '20 08:09 moodyblue

Feedback pls

moodyblue avatar Sep 22 '20 16:09 moodyblue

Ok right, sorry.

I was able set a virtual environment in Fedora to run python2 but now I get this error:

Traceback (most recent call last): File "./PlexConnect.py", line 20, in import DNSServer, WebServer File "/home/mzigaib/Downloads/PlexConnect/DNSServer.py", line 116 print "ID {0:04x}".format((ord(paket[0])<<8)+ord(paket[1])) ^ SyntaxError: invalid syntax

I also have a laptop with Mint and everything went fine, the problem is if I try to run it on Fedora 31. Any tips?

Thanks again for the help.

mzigaib avatar Sep 22 '20 16:09 mzigaib

New update: I did make it work with:

sudo python2 ./PlexConnect.py

Much simpler than I though, lack of experience with python on my side sorry.

Thanks again for all the help!

mzigaib avatar Sep 22 '20 16:09 mzigaib

Great. Closing the issue

moodyblue avatar Sep 22 '20 16:09 moodyblue