Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Fundamentals 4 min read

How to Fix pip Uninstall Errors for NumPy When Installing Pandas on macOS

When rebuilding a Plotly environment on macOS, pip fails to uninstall the system‑installed NumPy, causing pandas installation errors, and the solution involves manually removing NumPy’s egg‑info, using a reliable PyPI mirror, and selecting compatible library versions.

While re‑creating a Plotly environment on a Mac, the author encountered an error when trying to install pandas with pip because pip could not uninstall the existing numpy package:

Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

The message indicates that NumPy was installed via distutils as part of the system Python, so pip cannot safely remove it.

To work around this, the author manually inspected the system library directory, located the NumPy egg‑info file, and moved it to a backup location:

/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python$ ls | grep numpy
numpy-1.8.0rc1-py2.7.egg-info
sudo mv numpy-1.8.0rc1-py2.7.egg-info /Users/fv/

After backing up the egg‑info, the author re‑installed NumPy and pandas using the Tsinghua University PyPI mirror (which is faster for users in China):

sudo pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple numpy
sudo pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple pandas

Additional tips highlighted:

Older NumPy versions (e.g., 2.4) are more stable on macOS; newer 3.+ releases have many bugs.

Always verify dependency versions; an outdated version can cause Plotly to report missing modules.

By manually handling the system‑installed NumPy and using a reliable mirror with compatible versions, the pandas installation succeeds and the Plotly environment can be restored.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

TroubleshootingmacOSPandasNumPyPlotlypip

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion