Skip to content

With MacOS and PyPy installation fails: AttributeError: 'LooseVersion' object has no attribute 'version' #26536

Closed
@bhy

Description

@bhy

On MacOS 10.14, PyPy3.6-7.1.1 installation fails:

$ pip3 install pandas
Collecting pandas
  Using cached https://files.pythonhosted.org/packages/b2/4c/b6f966ac91c5670ba4ef0b0b5613b5379e3c7abdfad4e7b89a87d73bae13/pandas-0.24.2.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/50/8j9r2pm93n15lw18936l7zkc0000gn/T/pip-install-96rmqzke/pandas/setup.py", line 438, in <module>
        if python_target < '10.9' and current_system >= '10.9':
      File "/Users/haoyu/.pyenv/versions/pypy3.6-7.1.1/lib-python/3/distutils/version.py", line 52, in __lt__
        c = self._cmp(other)
      File "/Users/haoyu/.pyenv/versions/pypy3.6-7.1.1/lib-python/3/distutils/version.py", line 335, in _cmp
        if self.version == other.version:
    AttributeError: 'LooseVersion' object has no attribute 'version'

A workaround is to install with:
MACOSX_DEPLOYMENT_TARGET=10.14.4 pip3 install pandas

The cause for this is that in pandas setup.py, get_config_var('MACOSX_DEPLOYMENT_TARGET') will return None on PyPy, while a version number like 10.9 is expected. (See https://github.com/pandas-dev/pandas/blob/master/setup.py#L453).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BuildLibrary building on various platforms

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions