Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUILD: Trouble installing pandas on Windows #60947

Open
1 task done
bemali-beep opened this issue Feb 17, 2025 · 7 comments
Open
1 task done

BUILD: Trouble installing pandas on Windows #60947

bemali-beep opened this issue Feb 17, 2025 · 7 comments
Labels
Build Library building on various platforms Needs Info Clarification about behavior needed to assess issue

Comments

@bemali-beep
Copy link

Installation check

Platform

Gerät PRN konnte nicht initialisiert werden.

Installation Method

pip install

pandas Version

2.2.3

Python Version

3.11.9

Installation Logs

Hello everyone,
I am currently trying to install asreview from Uni Utrecht, but there accurs a problem which seems to be related to pandas installation.
As I tried installing pandas the same error occurs. See below:
The installation is to be executed right from Windows command line.

pip install pandas
Defaulting to user installation because normal site-packages is not writeable
Collecting pandas
Using cached pandas-2.2.3.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
╰─> [12 lines of output]
+ meson setup C:*\AppData\Local\Temp\pip-install-zbkfzy9s\pandas_2ad6fccfe0c843c78cc606c094498a41 C:*\AppData\Local\Temp\pip-install-zbkfzy9s\pandas_2ad6fccfe0c843c78cc606c094498a41.mesonpy-yu7welhd\build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --vsenv --native-file=C:********\AppData\Local\Temp\pip-install-zbkfzy9s\pandas_2ad6fccfe0c843c78cc606c094498a41.mesonpy-yu7welhd\build\meson-python-native-file.ini
The Meson build system
Version: 1.2.1
Source dir: C:*
\AppData\Local\Temp\pip-install-zbkfzy9s\pandas_2ad6fccfe0c843c78cc606c094498a41
Build dir: C:*
**\AppData\Local\Temp\pip-install-zbkfzy9s\pandas_2ad6fccfe0c843c78cc606c094498a41.mesonpy-yu7welhd\build
Build type: native build
Project name: pandas
Project version: 2.2.3

  ..\..\meson.build:2:0: ERROR: Could not parse vswhere.exe output

  A full log can be found at C:\********\AppData\Local\Temp\pip-install-zbkfzy9s\pandas_2ad6fccfe0c843c78cc606c094498a41\.mesonpy-yu7welhd\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 hope I gathered all infromation you need and to help me.

@bemali-beep bemali-beep added Build Library building on various platforms Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 17, 2025
@jvlevinson
Copy link

This looks like you might be having issues with C in your vscode environment. I had a similar issue where one of my msys package QT6 to be specific, was causing issues with the install and C. I initially started to upgrade my wheel but saw an error on sb perl so I upgraded only to see that the Msys was initally the issue. I uninstalled msys, rebooted my laptop, deleted my newly created .venv, created a new one and this solved my issue.

Check a few things:

  1. Missing or Misconfigured Build Tools:
    The log shows Meson being invoked with the --vsenv flag, which means it’s expecting a properly configured Visual Studio (MSVC) environment. If you don’t have the required Visual C++ Build Tools or if they’re not correctly set up, the build will fail.

  2. Fallback to Source Build:
    Normally, pandas provides precompiled wheels. If pip can’t find a wheel for your specific Python version or system architecture, it falls back to building from source. Building from source requires all the proper compilers and dependencies to be installed on your machine.

  3. Outdated Build Dependencies:
    Sometimes an outdated version of pip, setuptools, or wheel can lead to build issues. Ensuring these are up to date can sometimes resolve the problem.

How to fix it:

  • Install/Configure Build Tools:
    On Windows, install the latest [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/). Make sure that your environment variables are set correctly so that pip (and Meson) can find the C compiler.

  • Update Your Packaging Tools:
    Run:

    pip install --upgrade pip setuptools wheel
  • Check for a Pre-built Wheel:
    If you’re on a less common platform or using an unusual Python version, consider switching to a supported configuration where binary wheels are available.

By addressing these points, you should be able to resolve the error and successfully install pandas. Hope that helps!

References:
https://visualstudio.microsoft.com/visual-cpp-build-tools/

@rhshadrach rhshadrach added Needs Info Clarification about behavior needed to assess issue and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 17, 2025
@rhshadrach
Copy link
Member

Do you have wheel installed? If not, I recommend installing it first with pip install wheel, then installing pandas.

If this doesn't resolve your issue, can you tell us details about your system: namely what kind of architecture you are on.

@rhshadrach rhshadrach changed the title BUILD: BUILD: Trouble installing pandas on Windows Feb 17, 2025
@bemali-beep
Copy link
Author

hey rhshadrach,
unfortunately it didn't solve the issue.
My System:
Windows 10 Enterprise 64bit

@bemali-beep
Copy link
Author

Dear jvlevinson,

when I execute the vs_BuildTools.exe I get to a page where I can select multiple "Workloads". It's in german since I am located there. There is nothing really close but there are things about c++. I am unsecure what to select.
Below is a screenshot of the top of the page

Image

@rhshadrach
Copy link
Member

For some reason pip is installing the sdist (source distribution) rather than the wheel. I would suggesting trying to download the wheel directly and see why pip is not able to use it.

Wheel: https://files.pythonhosted.org/packages/ed/8c/87ddf1fcb55d11f9f847e3c69bb1c6f8e46e2f40ab1a2d2abadb2401b007/pandas-2.2.3-cp311-cp311-win_amd64.whl

Command: pip install pandas-2.2.3-cp311-cp311-win_amd64.whl

@bemali-beep
Copy link
Author

This is the return:

C:*********>pip install pandas-2.2.3-cp311-cp311-win_amd64.whl
Defaulting to user installation because normal site-packages is not writeable
ERROR: pandas-2.2.3-cp311-cp311-win_amd64.whl is not a supported wheel on this platform.

@rhshadrach
Copy link
Member

Ah, I was hopeful there might be a more informative error message. My guess is that you do not have amd64 in that case, which are the only wheels pandas produces for Windows. So you will have to follow what @jvlevinson was saying and try to compile pandas yourself.

https://pandas.pydata.org/pandas-docs/dev/development/contributing_environment.html

The other option would be to try conda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Needs Info Clarification about behavior needed to assess issue
Projects
None yet
Development

No branches or pull requests

3 participants