Skip to main content
Answer

Getting " error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2" when run poetry add pandas

  • December 19, 2023
  • 3 replies
  • 3704 views

Pasindu Perera
Seasoned Practitioner
Forum|alt.badge.img+2

I am getting following error during the execution of poetry add pandas command in Data Engineer Basics - Integrate course. I have attached the complete output for you reference. Prevously I got an error saying install the latest Microsoft Visual Studio C++. After installing latest Visual Studio C++ I got this error.

```

 error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2


at ~\AppData\Roaming\pypoetry\venv\Lib\site-packages\poetry\installation\chef.py:164 in _prepare
160│
161│ error = ChefBuildError("\n\n".join(message_parts))
162│
163│ if error is not None:
→ 164│ raise error from None
165│
166│ return path
167│
168│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with pyzmq (25.0.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pyzmq (==25.0.2)"'.

 

Best answer by Ben Petree

It looks like pandas is only supported on 3.9, 3.10, and 3.11

https://pandas.pydata.org/docs/getting_started/install.html#python-version-support

3 replies

Ben Petree
Seasoned Practitioner
Forum|alt.badge.img+4
  • Seasoned Practitioner
  • December 19, 2023

Can you attach your pyproject.toml please? I think you are using python 3.12 but I’d like to try and reproduce this


Ben Petree
Seasoned Practitioner
Forum|alt.badge.img+4
  • Seasoned Practitioner
  • Answer
  • December 19, 2023

It looks like pandas is only supported on 3.9, 3.10, and 3.11

https://pandas.pydata.org/docs/getting_started/install.html#python-version-support


Pasindu Perera
Seasoned Practitioner
Forum|alt.badge.img+2
  • Author
  • Seasoned Practitioner
  • December 20, 2023

Hi Ben issue is now resolved.

Actually the reason is python version. I have used the latest python version (3.12)

I have degraded it to 3.10 and now it it working.