Installation problems - python3 issue

Hi

I’m struggling to install LT on centos-6.

Of course, my Python version is out of date. So I used pyenv to install a version 3 of Python:

itcrowd@machine:~# pyenv global 3.7.4 itcrowd@machine:~# python --version Python 3.7.4

So that’s fixed.

But when I try to install LT, the installer throws out a bunch of messages as follows:

SyntaxError: Missing parentheses in call to 'print'.

So, I dutifully change all the instances of print whatever to print(whatever) in all of the setup.py files that I can find.

However, I am stuck with one last one as follows:

File "/tmp/easy_install-gecdxuoa/wsgiref-0.1.2/ez_setup/__init__.py", line 170 print "Setuptools version",version,"or greater has been installed." ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Setuptools version",version,"or greater has been installed.")?

Of course, I have searched for the relevant file(s) to change this by hand but is it really necessary for me to update all of the instalation files manually to be coimpatible with the Python3 print command?

Yeah, so it appears to be a an issue with installing wsgiref as follows:

Best match: wsgiref 0.1.2 Processing wsgiref-0.1.2.zip
Writing /tmp/easy_install-qi2zc_ab/wsgiref-0.1.2/setup.cfg Running wsgiref-0.1.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-qi2zc_ab/wsgiref-0.1.2/egg-dist-tmp-bk6_7as4 Traceback (most recent call last):
File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 154, in save_modules yield saved File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 195, in setup_context yield
File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 250, in run_setup _execfile(setup_script, ns) File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 45, in _execfile exec(code, globals, locals) File "/tmp/easy_install-qi2zc_ab/wsgiref-0.1.2/setup.py", line 5, in <module>

File "/tmp/easy_install-qi2zc_ab/wsgiref-0.1.2/ez_setup/__init__.py", line 170 print "Setuptools version",version,"or greater has been installed." ^ SyntaxError: Missing parentheses in call to 'print'

So how to overcome this? Many thanks in advance.

Ok, progress - putting this down for reference.

wsgiref was installed in Python2.7:

ls /usr/lib/python2.7/wsgiref
__init__.py handlers.py headers.py simple_server.py util.py validate.py __init__.pyc handlers.pyc headers.pyc simple_server.pyc util.pyc validate.pyc

And this:

ls /usr/lib/python2.7/wsgiref.egg-info

In Python 3.5, wsgiref was installed:

ls /usr/lib/python3.5/wsgiref __init__.py __pycache__ handlers.py headers.py simple_server.py util.py validate.py

But the other file was not installed - so I created a symlink to it:

ls /usr/lib/python3.5/wsgiref.egg-info -la
/usr/lib/python3.5/wsgiref.egg-info -> /usr/lib/python2.7/wsgiref.egg-info

Got past that error and now have a new one:

Searching for poster Reading https://pypi.org/simple/poster/ Downloading https://files.pythonhosted.org/packages/9f/dc/0683a458d21c3d561ab2f71b4fcdd812bf04e55c54e560b0854cea95610e/poster-0.8.1.tar.gz#sha256=af5bf45da4a916db2b638cffd9e9d6668b33020e2b8ca9f864db79b49331c6ff Best match: poster 0.8.1 Processing poster-0.8.1.tar.gz Writing /tmp/easy_install-fbzwuq7h/poster-0.8.1/setup.cfg Running poster-0.8.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-fbzwuq7h/poster-0.8.1/egg-dist-tmp-iagvdsyh Traceback (most recent call last): File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 154, in save_modules yield saved File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 250, in run_setup _execfile(setup_script, ns) File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 45, in _execfile exec(code, globals, locals) File "/tmp/easy_install-fbzwuq7h/poster-0.8.1/setup.py", line 2, in <module> from subprocess import call File "/tmp/easy_install-fbzwuq7h/poster-0.8.1/poster/__init__.py", line 29, in <module> File "/tmp/easy_install-fbzwuq7h/poster-0.8.1/poster/streaminghttp.py", line 61 print "send:", repr(value) ^ SyntaxError: invalid syntax

Need to install poster under Python3:

itcrowd@machine:~# python -V Python 2.7.12 itcrowd@machine:~# pip install poster DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support Requirement already satisfied: poster in /usr/local/lib/python2.7/dist-packages/poster-0.8.1-py2.7.egg (0.8.1)

Create symlink:

itcrowd@machine:~# ln -s /usr/local/lib/python2.7/dist-packages/poster-0.8.1-py2.7.egg /usr/local/lib/python3.5/dist-packages/

Download poster and install manually:

pip install -e /tmp/poster-0.8.1

Haven’t got around it:

Best match: poster 0.8.1 Processing poster-0.8.1.tar.gz Writing /tmp/easy_install-17mobkdn/poster-0.8.1/setup.cfg Running poster-0.8.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-17mobkdn/poster-0.8.1/egg-dist-tmp-85g_tnzf Traceback (most recent call last): File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 154, in save_modules yield saved File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 250, in run_setup _execfile(setup_script, ns) File "/root/environments/env/lib/python3.5/site-packages/setuptools/sandbox.py", line 45, in _execfile exec(code, globals, locals) File "/tmp/easy_install-17mobkdn/poster-0.8.1/setup.py", line 2, in <module> from subprocess import call File "/tmp/easy_install-17mobkdn/poster-0.8.1/poster/__init__.py", line 29, in <module> File "/tmp/easy_install-17mobkdn/poster-0.8.1/poster/streaminghttp.py", line 61 print "send:", repr(value) ^ SyntaxError: invalid syntax