1

I am installing pandas new version 1.0.3 using below command pip3 install pandas.

But I am getting below error

Collecting pandas
  Using cached https://files.pythonhosted.org/packages/2f/79/f236ab1cfde94bac03d7b58f3f2ab0b1cc71d6a8bda3b25ce370a9fe4ab1/pandas-1.0.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-d_rfkjs6/pandas/setup.py", line 42
        f"numpy >= {min_numpy_ver}",
                                  ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-d_rfkjs6/pandas/
You are using pip version 8.1.1, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I have tried installing pandas from below command

apt-get install python3-pandas

This commands work But it installs the old version of pandas.

I am using python 3.5 version and wanted to install latest version of pandas 1.0.3

3
  • Did you ever hear of a thing called a Python virtual environment?
    – karel
    Apr 29, 2020 at 14:58
  • I have no problems with pip3 install pandas on 19.10, python 3.7, pip 18.1. So specify your specs: pip3 --version, cat /etc/lsb-release by editing your question.
    – Gryu
    Apr 29, 2020 at 15:02
  • I was also able to install it on 16.04, but it installs old version of pandas: 0.24.... Also, do what it asks: pip install --upgrade pip
    – Gryu
    Apr 29, 2020 at 15:22

2 Answers 2

1

Your error says you need to upgrade your pip:

pip install --upgrade pip

Or you could also try:

pip3 install --upgrade pip

Then pip3 -V should show you correct version it mentioned about.

Then try installing pandas using pip3 install pandas

On 19.10 it installs the latest version, but on 16.04 it installs older version. I think, it's because of newer versions of pandas do not support python 3.5:

Python version support
Officially Python 3.6.1 and above, 3.7, and 3.8

0

Pandas 1.0.3 requires python 3.6.1 or above. So you would have to upgrade python first. I would look to see if switching to a higher version of python is an option, otherwise, you can only use pandas 0.25 on python 3.5.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .