'Double requirement given when trying to use pip install pandas

I want to build a Docker container using a Dockerfile containing pip install -r requirements.txt. pandas==0.22.0 is included in this requirements.txt file. Untill two days ago, the Docker container was perfectly build. Starting from yesterday, I receive an error:

Double requirement given: numpy==1.12.1 from https://pypi.python.org/packages/02/64/c6c1c24ff4dbcd789fcfdb782e343ac23c074f6b8b03e818ff60eb0f937f/numpy-1.12.1-cp34-cp34m-manylinux1_x86_64.whl#md5=6288d4e9cfea859e03dc82879539d029 (already in numpy==1.9.3 from https://pypi.python.org/packages/fc/1b/a1717502572587c724858862fd9b98a66105f3a3443225bda9a1bd16ee14/numpy-1.9.3-cp34-cp34m-manylinux1_x86_64.whl#md5=e1130c8f540a759d79ba5e8960f6915a, name='numpy')

This error occurs both on Mac (Docker version: 18.03.0-ce-mac58 (23607)) and Ubuntu 16.04.3 (Docker version: 17.12.0-ce, build c97c6d6).

I already tried to use different versions op pandas, to preinstall numpy, to remove pands from the requirements.txt file and install it seperately. As well as trying to install with apt-get install python-pandas. For the latter solution pandas v14 was installed, while I need at least v19.



Solution 1:[1]

I finally found the solution for this in case of python3 or pip3

pip3 install pandas --no-build-isolation

Solution 2:[2]

As of December 2020, in my case, upgrading pip to version 20.3 worked well.

Solution 3:[3]

Might be of use to those who are working on Python3.4:

pip3 install 'pandas<0.21'

worked for me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vinzee
Solution 2 vinzee
Solution 3 vinzee