Python Forum
Trying to run a python2 script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to run a python2 script
#1
Hello,
im trying to run a script called Ingress-maxfield. It was made on Python 2.7
https://github.com/tvwenger/maxfield/

the script dependencies are as follows:
distribute==0.7.3
matplotlib==1.3.1
networkx==1.8.1
numpy==1.8.1
docopt==0.6.1
pandas==0.14.1
pebble==3.1.14


I have tried everything from "pip install -r requirements.txt" as mentioned on its github page, to trying to install all dependencies separately. I also tried modifying the script from Python2 to 3 but i dont know how to code i just saw a bunch of tutorials and tried some stuff.
Ive tried this on a fresh ubuntu setup, buster and raspberry pi.

if anyone can please help me run this script it would be much appreciated.

PS- The owner of the script and github page is not active since quite a long time. people have tried reaching out on issues page on github but there are no replies. however, those who have the older version installed on their system, can still run the script with no issues.



Error displayed:

(venv) phoenix@debian-maxfield:~/maxfield$ pip install -r requirements.txt
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting distribute==0.7.3 (from -r requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/...-0.7.3.zip
Collecting matplotlib==1.3.1 (from -r requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/...3.1.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: ============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
matplotlib: yes [1.3.1]
python: yes [2.7.16 (default, Apr 6 2019, 01:42:57) [GCC
8.3.0]]
platform: yes [linux2]

REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [not found. pip may install it below.]
dateutil: yes [dateutil was not found. It is required for date
axis support. pip/easy_install may attempt to
install it after matplotlib.]
tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
pyparsing: yes [pyparsing was not found. It is required for
mathtext support. pip/easy_install may attempt to
install it after matplotlib.]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: yes [version 22.1.16]
png: yes [version 1.6.36]

OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite]

OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt4agg: no [PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: no [TKAgg requires Tkinter.]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairo not found]
windowing: no [Microsoft Windows only]

OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: no
latex: no
pdftops: no

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-BpDEhz/matplotlib/setup.py", line 268, in <module>
**extra_args
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
replace_conflicting=True,
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
replace_conflicting=replace_conflicting
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
return installer(requirement)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
return cmd.easy_install(req)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 679, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 705, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 890, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1158, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
run_setup(setup_script, args)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
raise
File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-_UMBCn/numpy-1.17.0rc2/setup.py", line 31, in <module>
try:
RuntimeError: Python version >= 3.5 required.
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-
(venv) phoenix@debian-maxfield:~/maxfield$ python --version
Python 2.7.16
Reply


Messages In This Thread
Trying to run a python2 script - by dagamer1991 - Aug-12-2019, 12:21 PM
RE: Trying to run a python2 script - by buran - Aug-12-2019, 12:25 PM
RE: Trying to run a python2 script - by dagamer1991 - Aug-12-2019, 12:28 PM
RE: Trying to run a python2 script - by buran - Aug-12-2019, 12:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Sad Migrating of python2 script to python3 zuri 7 4,860 Oct-05-2023, 02:40 PM
Last Post: snippsat
  python2 python3 messed up : How to fix ? hary 15 12,017 Dec-30-2020, 08:26 PM
Last Post: hary
  using pudb on python2 code ErnestTBass 2 2,550 Aug-10-2020, 08:12 PM
Last Post: snippsat
  python2.7 executables thus the system python2.7 was erroring utility.execute()? vivekm 1 2,410 May-20-2019, 11:24 AM
Last Post: vivekm
  Python2 is not supported Skaperen 2 3,129 Mar-01-2019, 07:50 PM
Last Post: stranac
  Problem in a python2 file sylas 15 11,017 Aug-08-2018, 08:54 AM
Last Post: sylas
  byte string in python2 Skaperen 4 5,551 Nov-23-2017, 03:13 AM
Last Post: Skaperen
  Different outputs in Python2 and Python3 MikeHill 3 5,121 Jun-07-2017, 08:58 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

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