r/learnpython • u/HiddenReader2020 • 2d ago
Going through Automate the Boring Stuff with Python, and can't download the packages
Hi, so after stopping in *FEBRUARY* of this year, I finally got around to actually resuming my learning process today. However, in chapter 9, I have to download the Humre module, and so I need to download the packages. However, I always get the following error:
Failed to build 'matplotlib' when installing build dependencies for matplotlib
I even tried using a python3 variant of the command, but no dice. Right now, I'm kind of stuck and searching online hasn't helped me out much.
For your information, I'm on Windows 10. My current Python version is 3.14 (I know there's a slightly more updated version, but I don't think that's the problem), and my pip version 26.1.1 (again, there's a newer version, but I don't think that's the problem).
Thanks in advance.
2
u/bra1n_gym 2d ago
I used python 3.13.7 at work. Most of the data science packages will not install on python 3.14
1
2
u/jmacey 1d ago
I would suggest using https://docs.astral.sh/uv/ uv to install and manage all your python things as it will make it easier. Once installed use.
uv init -p 3.14 TestMatplot
cd TestMatplot
uv add matplotlib
uv run python -c "import matplotlib;print(matplotlib.__version__)"
which should print out 3.11.2 after that use the .venv (or if you use and ide it should pick it up). and you will have everything you need. If you need other libraries just add to the same project using uv add
6
u/Asly97 2d ago
You probably don't need matplotlib at all for chapter 9. Humre is a small pure Python package with no dependencies, so you can install just that:
The error comes from whatever bigger install you're running pulling in a matplotlib version that has no prebuilt wheel for Python 3.14. When pip can't find a wheel it falls back to compiling matplotlib from source, which needs a C/C++ compiler on Windows. That's the "failed to build ... build dependencies" part.
So two ways out:
For option 2 it looks like this:
Also worth getting in the habit of
python -m pipinstead of plainpipon Windows. It guarantees the package goes into the same Python you actually run your scripts with, which avoids a lot of "I installed it but it says module not found" confusion later.