Pandas: pip install on Python2.7 not working

Created on 1 Jul 2019  Â·  10Comments  Â·  Source: pandas-dev/pandas

pip install on Python2.7 fails with the error:

RuntimeError: Python version >= 3.5 required.

this is because numpy has a release version 1.7 which requires 3.5 or above

https://github.com/numpy/numpy/blob/maintenance/1.17.x/setup.py

is it okay to add a dependency check in setup.py? i can do that and submit for review or let me know how do you suggest we address this?

Most helpful comment

reproduce in python2.7.10 @TomAugspurger

  • environment

(p2) [7:01:19] ~ $ python --version Python 2.7.10

(p2) [7:01:27] ~ $ pip --version pip 19.2.1 from /Users/zs/.virtualenvs/p2/lib/python2.7/site-packages/pip (python 2.7)

  • pip install pandas==0.23.4
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting pandas==0.23.4
  Using cached https://mirrors.aliyun.com/pypi/packages/86/ad/89670f4017b2459dfb5577775efbc4c6c20eb46728ac6e5b721602493724/pandas-0.23.4-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting numpy>=1.9.0 (from pandas==0.23.4)
  Using cached https://mirrors.aliyun.com/pypi/packages/da/32/1b8f2bb5fb50e4db68543eb85ce37b9fa6660cd05b58bddfafafa7ed62da/numpy-1.17.0.zip
    ERROR: Command errored out with exit status 1:
     command: /Users/zs/.virtualenvs/p2/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/setup.py", line 31, in <module>
        raise RuntimeError("Python version >= 3.5 required.")
    RuntimeError: Python version >= 3.5 required.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

All 10 comments

Pandas master doesn't support 2.7. The next release will require 3.5.

If you're using a recent version of pip, then pip install pandas will respect the python_requires field to only install a version of NumPy and pandas that support python 2.7.

its not just master, you will see this issue on build 0.23.4 as well and yes i am using latest pip @TomAugspurger

Can you post the full output of pip install pandas into a clean
virtualenv?

On Mon, Jul 1, 2019 at 7:59 AM Bala Kumaran notifications@github.com
wrote:

its not just master, you will see this issue on pandas==0.23.4 as well and
yes i am using latest pip @TomAugspurger
https://github.com/TomAugspurger

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/pandas-dev/pandas/issues/27159?email_source=notifications&email_token=AAKAOIUP6NCPFHFU24D2HQTP5H5UBA5CNFSM4H4RWYG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY6BK6Q#issuecomment-507254138,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKAOIUL6ZMS276XSFNH6PLP5H5UBANCNFSM4H4RWYGQ
.

I logged an issue against pip with the full output of pip install --no-binary=pandas pandas. If a Python 2.7 environment lacks wheel support, then it may trigger the same result as using the --no-binary option to pip.

The suggested workaround was to install numpy first, and then install pandas.

Thanks for following up. It sounds like this is what pyproject.toml should
eventually fix?

On Mon, Jul 1, 2019 at 8:22 AM Tyson Clugg notifications@github.com wrote:

I logged an issue against pip with the full output of pip install
--no-binary=pandas pandas. If a Python 2.7 environment lacks wheel
support, then it may trigger the same result as using the --no-binary
option to pip.

The suggested workaround
https://github.com/pypa/pip/issues/6667#issuecomment-507164431 was to
install numpy first, and then install pandas.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/pandas-dev/pandas/issues/27159?email_source=notifications&email_token=AAKAOIXXNZYXRVIZSSFXEJDP5IAINA5CNFSM4H4RWYG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY6DIUY#issuecomment-507262035,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKAOITVYJAVB7UUL32AWQ3P5IAINANCNFSM4H4RWYGQ
.

Thanks for following up. It sounds like this is what pyproject.toml should eventually fix?

I'm not the OP of this issue, I chimed in because it would seem that my issue was quite possibly the same as this, but not definitely. We should wait for @BalakumaranS to provide more details before assuming they are the same.

In the meantime, I think there is enough evidence in the ticket I logged to warrant this ticket being re-opened. I pinged this issue rather than opening my own, since duplicates tickets don't help much.

we use pex for packaging so i found now that this is more of pex issue than anything else for me now, thanks for the inputs provided
let me fix the pex issue first and will post an update if the issue reoccurs or not

reproduce in python2.7.10 @TomAugspurger

  • environment

(p2) [7:01:19] ~ $ python --version Python 2.7.10

(p2) [7:01:27] ~ $ pip --version pip 19.2.1 from /Users/zs/.virtualenvs/p2/lib/python2.7/site-packages/pip (python 2.7)

  • pip install pandas==0.23.4
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting pandas==0.23.4
  Using cached https://mirrors.aliyun.com/pypi/packages/86/ad/89670f4017b2459dfb5577775efbc4c6c20eb46728ac6e5b721602493724/pandas-0.23.4-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting numpy>=1.9.0 (from pandas==0.23.4)
  Using cached https://mirrors.aliyun.com/pypi/packages/da/32/1b8f2bb5fb50e4db68543eb85ce37b9fa6660cd05b58bddfafafa7ed62da/numpy-1.17.0.zip
    ERROR: Command errored out with exit status 1:
     command: /Users/zs/.virtualenvs/p2/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/setup.py", line 31, in <module>
        raise RuntimeError("Python version >= 3.5 required.")
    RuntimeError: Python version >= 3.5 required.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

That error is in NumPy’s setup.py. You’d see that from any package depending on NumPy.

You should make sure you have a binary distribution of NumPy in place to avoid executing its setup.py.

On Aug 4, 2019, at 18:07, zs1621 notifications@github.com wrote:

reproduce in python2.7.10 @TomAugspurger

environment
(p2) [7:01:19] ~ $ python --version Python 2.7.10

(p2) [7:01:27] ~ $ pip --version pip 19.2.1 from /Users/zs/.virtualenvs/p2/lib/python2.7/site-packages/pip (python 2.7)

pip install pandas==0.23.4
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting pandas==0.23.4
Using cached https://mirrors.aliyun.com/pypi/packages/86/ad/89670f4017b2459dfb5577775efbc4c6c20eb46728ac6e5b721602493724/pandas-0.23.4-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting numpy>=1.9.0 (from pandas==0.23.4)
Using cached https://mirrors.aliyun.com/pypi/packages/da/32/1b8f2bb5fb50e4db68543eb85ce37b9fa6660cd05b58bddfafafa7ed62da/numpy-1.17.0.zip
ERROR: Command errored out with exit status 1:
command: /Users/zs/.virtualenvs/p2/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/
Complete output (5 lines):
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/gb/1cyr_00d6vg3dbq5r2c9wym80000gn/T/pip-install-9wnTUG/numpy/setup.py", line 31, in
raise RuntimeError("Python version >= 3.5 required.")
RuntimeError: Python version >= 3.5 required.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@TomAugspurger yes

pip install numpy==1.10.4 then install pandas success thanks ~~

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BDannowitz picture BDannowitz  Â·  3Comments

venuktan picture venuktan  Â·  3Comments

ebran picture ebran  Â·  3Comments

scls19fr picture scls19fr  Â·  3Comments

matthiasroder picture matthiasroder  Â·  3Comments