Search code examples
pythonpandaspip

Pip install fails for pandas


I am trying to install pandas on a Windows machine but get the following output:

python -m pip install pandas
Collecting pandas
  Using cached pandas-2.2.2.tar.gz (4.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
      + meson setup C:\Users\serba\AppData\Local\Temp\pip-install-6cc_jg_i\pandas_90906587555b4b9d852626b7159094db C:\Users\serba\AppData\Local\Temp\pip-install-6cc_jg_i\pandas_90906587555b4b9d852626b7159094db\.mesonpy-6bapjes7\build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --vsenv --native-file=C:\Users\serba\AppData\Local\Temp\pip-install-6cc_jg_i\pandas_90906587555b4b9d852626b7159094db\.mesonpy-6bapjes7\build\meson-python-native-file.ini
      The Meson build system
      Version: 1.2.1
      Source dir: C:\Users\serba\AppData\Local\Temp\pip-install-6cc_jg_i\pandas_90906587555b4b9d852626b7159094db
      Build dir: C:\Users\serba\AppData\Local\Temp\pip-install-6cc_jg_i\pandas_90906587555b4b9d852626b7159094db\.mesonpy-6bapjes7\build
      Build type: native build
      Project name: pandas
      Project version: 2.2.2
      Activating VS 15.9.60

      ..\..\meson.build:2:0: ERROR: Value "c11" (of type "string") for combo option "C language standard to use" is not one of the choices. Possible choices are (as string): "none", "c89", "c99", "gnu89", "gnu90", "gnu9x", "gnu99".

      A full log can be found at C:\Users\serba\AppData\Local\Temp\pip-install-6cc_jg_i\pandas_90906587555b4b9d852626b7159094db\.mesonpy-6bapjes7\build\meson-logs\meson-log.txt
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I tried the following:

  • running the terminal as administrator
  • updating pip
  • installing older versions of pandas because I read there is some issue with the latest one
  • looking inside the log file from the output, but it doesn't exist anymore after the process finishes

The output is still the same.

I see it complaining about a C standard. Do I need a specific compiler to be installed or any other prerequisites?

Thanks. Regards, Serban


Solution

  • So I got past this, it was a stupid reason this was happening. I had another pip binary somewhere in a MinGW installation folder and it was always calling that one. I made sure change the environment variables to point to a proper, standalone installation of pip (also python).