2

I'm using Python 3.9 with Mac OS X (Big Sur). I want to install pandas. I'm using pip, but this fails

pip install pandas

resulting in this error message

Collecting pandas
  Using cached pandas-1.2.0.tar.gz (5.4 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/davea/Documents/workspace/chicommons/maps/web/venv/bin/python3 /Users/davea/Documents/workspace/chicommons/maps/web/venv/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/hm/_tf9xpw10mb0tffdv32g8lrh0000gn/T/pip-build-env-r7sphyv3/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.29.21,<3' 'numpy==1.16.5; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.5; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy; python_version>='"'"'3.9'"'"''
       cwd: None
  Complete output (2009 lines):
  Ignoring numpy: markers 'python_version == "3.7" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.8" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.7" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.8" and platform_system == "AIX"' don't match your environment
  Collecting setuptools
    Using cached setuptools-51.1.0-py3-none-any.whl (2.0 MB)
  Collecting wheel
    Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
  Collecting Cython<3,>=0.29.21
    Using cached Cython-0.29.21-py2.py3-none-any.whl (974 kB)
  Collecting numpy
    Using cached numpy-1.19.4.zip (7.3 MB)
...
    build/bdist.macosx-10.9-universal2/wheel/numpy/random/mtrand.cpython-39-darwin.so
    build/bdist.macosx-10.9-universal2/wheel/numpy/random/_generator.cpython-39-darwin.so
    build/bdist.macosx-10.9-universal2/wheel/numpy/random/_pcg64.cpython-39-darwin.so
    build/bdist.macosx-10.9-universal2/wheel/numpy/random/_sfc64.cpython-39-darwin.so
    build/bdist.macosx-10.9-universal2/wheel/numpy/random/_mt19937.cpython-39-darwin.so
    build/bdist.macosx-10.9-universal2/wheel/numpy/random/_philox.cpython-39-darwin.so
    build/bdist.macosx-10.9-universal2/wheel/numpy/random/_bounded_integers.cpython-39-darwin.so
    build/bdist.macosx-10.9-universal2/wheel/numpy/random/_common.cpython-39-darwin.soTraceback (most recent call last):
      File "/Users/davea/Documents/workspace/chicommons/maps/web/venv/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
        main()
      File "/Users/davea/Documents/workspace/chicommons/maps/web/venv/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/Users/davea/Documents/workspace/chicommons/maps/web/venv/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 204, in build_wheel
        return _build_backend().build_wheel(wheel_directory, config_settings,
      File "/private/var/folders/hm/_tf9xpw10mb0tffdv32g8lrh0000gn/T/pip-build-env-w99svf08/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 211, in build_wheel
        return self._build_with_temp_dir(['bdist_wheel'], '.whl',
      File "/private/var/folders/hm/_tf9xpw10mb0tffdv32g8lrh0000gn/T/pip-build-env-w99svf08/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dir
        self.run_setup()
      File "/private/var/folders/hm/_tf9xpw10mb0tffdv32g8lrh0000gn/T/pip-build-env-w99svf08/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 248, in run_setup
        super(_BuildMetaLegacyBackend,
      File "/private/var/folders/hm/_tf9xpw10mb0tffdv32g8lrh0000gn/T/pip-build-env-w99svf08/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 142, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 508, in <module>
        setup_package()
      File "setup.py", line 500, in setup_package
        setup(**metadata)
      File "/private/var/folders/hm/_tf9xpw10mb0tffdv32g8lrh0000gn/T/pip-install-bom5tv_9/numpy/numpy/distutils/core.py", line 169, in setup
        return old_setup(**new_attr)
      File "/private/var/folders/hm/_tf9xpw10mb0tffdv32g8lrh0000gn/T/pip-build-env-w99svf08/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 165, in setup
        return distutils.core.setup(**attrs)
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/private/var/folders/hm/_tf9xpw10mb0tffdv32g8lrh0000gn/T/pip-build-env-w99svf08/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 328, in run
        impl_tag, abi_tag, plat_tag = self.get_tag()
      File "/private/var/folders/hm/_tf9xpw10mb0tffdv32g8lrh0000gn/T/pip-build-env-w99svf08/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 278, in get_tag
        assert tag in supported_tags, "would build wheel with unsupported tag {}".format(tag)
    AssertionError: would build wheel with unsupported tag ('cp39', 'cp39', 'macosx_11_0_universal2')
    ----------------------------------------
    ERROR: Failed building wheel for numpy
  Failed to build numpy
  ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
  WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
  You should consider upgrading via the '/Users/davea/Documents/workspace/chicommons/maps/web/venv/bin/python3 -m pip install --upgrade pip' command.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/davea/Documents/workspace/chicommons/maps/web/venv/bin/python3 /Users/davea/Documents/workspace/chicommons/maps/web/venv/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/hm/_tf9xpw10mb0tffdv32g8lrh0000gn/T/pip-build-env-r7sphyv3/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.29.21,<3' 'numpy==1.16.5; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.5; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy; python_version>='"'"'3.9'"'"'' Check the logs for full command output.

Not sure what else to try.

Dave
  • 15,639
  • 133
  • 442
  • 830
  • This should work `/Users/davea/Documents/workspace/chicommons/maps/web/venv/bin/python -m pip install pandas` – Philippe Dec 26 '20 at 21:40
  • Gave that a try but it results in the same error. – Dave Dec 26 '20 at 21:52
  • if you run `/Users/davea/Documents/workspace/chicommons/maps/web/venv/bin/python -m venv /tmp/venv` `source /tmp/venv/bin/activate` then `pip install pandas`, what do you get ? – Philippe Dec 26 '20 at 22:13
  • 1
    try upgrading pip – KetZoomer Dec 26 '20 at 22:40
  • Using the [Anaconda Distribution](https://www.anaconda.com/products/individual) may be a better option, as it comes with most required [packages](https://docs.anaconda.com/anaconda/packages/py3.8_osx-64/), including `pandas`. – Trenton McKinney Dec 26 '20 at 22:50
  • @KetZoomer, I upgraded pip to 20.3.3 and that did the trick. Thx – Dave Dec 27 '20 at 01:47
  • I had to [reinstall pip](https://stackoverflow.com/a/44809145/2093371) easy_install -U pip – hestellezg Feb 04 '21 at 07:40

1 Answers1

2

Credit to @KetZoomer. Upgrading pip by running

. venv/bin/activate
venv/bin/python -m pip install --upgrade pip

solved the problem.

KetZoomer
  • 2,701
  • 3
  • 15
  • 43
Dave
  • 15,639
  • 133
  • 442
  • 830