Error installing packages(Numpy) on older version of python

Question:

I’m trying to run code from a repository from 2016 that doesn’t label what versions of anything it’s using, but I think I figured out that it was using Python version 3.4. I went ahead and installed that python version, but when I went to install the dependencies, starting with Numpy, I got this error when running

pip install numpy

The error is as follows

    SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 17, in <module>

File "C:UserssamAppDataLocalTemppip_build_samnumpysetup.py", line 64

raise RuntimeError(f'Cannot parse version {FULLVERSION}')

                                                       ^

SyntaxError: invalid syntax

Not sure what to do. My machine is a windows-10-64bit Python version is 3.4.0 and pip version is 1.5.4. If anyone cares to see if there’s a more holistic way to get this code to run, this is the repo. https://github.com/czhuang/ChordRipple

Asked By: Sam Missner

||

Answers:

The setup script for the version of Numpy you’re trying to install is using an f-string. However, f-strings were introduced in Python 3.6, so your version does not support this. Installing an older version of numpy should work. Version 1.15.4 should be the latest one that supports Python 3.4.

pip install numpy==1.15.4 should do the trick.

Answered By: Marco Breemhaar
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.