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
#2
(Aug-12-2019, 12:18 PM)dagamer1991 Wrote: I have tried everything from "pip install -r requirements.txt" as mentioned on its github page, to trying to install all dependencies separately.

What was the result? Do you get any errors? It's good idea to use virtual environment to install the additional packages and run the script (to avoid changing the system installation)
If installation went OK, what you get when run the script?

(Aug-12-2019, 12:18 PM)dagamer1991 Wrote: 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.
There is 2to3 auto convertion tool that may do all/most of the work for you
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(Aug-12-2019, 12:25 PM)buran Wrote:
(Aug-12-2019, 12:18 PM)dagamer1991 Wrote: I have tried everything from "pip install -r requirements.txt" as mentioned on its github page, to trying to install all dependencies separately.

What was the result? Do you get any errors? It's good idea to use virtual environment to install the additional packages and run the script (to avoid changing the system installation)
If installation went OK, what you get when run the script?

(Aug-12-2019, 12:18 PM)dagamer1991 Wrote: 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.
There is 2to3 auto convertion tool that may do all/most of the work for you

Installation doesnt finish installing all the dependencies.
ive pasted the error result in my first post, at the end of the post.

and yes, i did auto 2to3, made a new script but that doesnt work too. Wall
Reply
#4
it looks it fails to install matplotlib
check the instructions on this page and to install it via apt-get
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Sad Migrating of python2 script to python3 zuri 7 955 Oct-05-2023, 02:40 PM
Last Post: snippsat
  python2.7 executables thus the system python2.7 was erroring utility.execute()? vivekm 1 1,750 May-20-2019, 11:24 AM
Last Post: vivekm
  Python2 is not supported Skaperen 2 2,155 Mar-01-2019, 07:50 PM
Last Post: stranac

Forum Jump:

User Panel Messages

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