#๐Ÿ”’ Can't install matplotlib

56 messages ยท Page 1 of 1 (latest)

ornate cometBOT
#

@loud carbon

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

loud carbon
#

Using venv, if that matters !(*๏ฟฃ(๏ฟฃใ€€*)
Python version: 3.13.0
Matplotlib version: 3.9.2

Output: https://paste.pythondiscord.com/KK3A
Ping if you reply, thank you

modest tendon
loud carbon
#

I can do python instead of py cause I'm on Windows

modest tendon
#

py is the windows launcher

modest tendon
#

Interesting. I'm guessing the py launcher wasn't included during the install

#

Can you verify that the venv is activated?

loud carbon
#

Not sure how to do that

#

but I used the VSCode Python extension to make an enviroment

modest tendon
#

So you may not have created and activated a venv then

loud carbon
#

Is this enough to be sure that it's activated

modest tendon
#

You need to run .\Scripts\activate

loud carbon
#

Oh wow okay

modest tendon
#

And now it should use that venv's python interpreter

loud carbon
#

Still same things with all 3 commands

modest tendon
#

One sec

#

!pypi meson

ornate cometBOT
#

A high performance build system

Released on <t:1729451026:D>.

modest tendon
loud carbon
#

In the venv?

modest tendon
#

Yup

loud carbon
#

Same thing still

modest tendon
#

Ok, might need to install Microsoft build tools

ornate cometBOT
#
Microsoft Visual C++ Build Tools

When you install a library through pip on Windows, sometimes you may encounter this error:

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

This means the library you're installing has code written in other languages and needs additional tools to install. To install these tools, follow the following steps: (Requires 6GB+ disk space)

1. Open https://visualstudio.microsoft.com/visual-cpp-build-tools/.
2. Click Download Build Tools >. A file named vs_BuildTools or vs_BuildTools.exe should start downloading. If no downloads start after a few seconds, click click here to retry.
3. Run the downloaded file. Click Continue to proceed.
4. Choose C++ build tools and press Install. You may need a reboot after the installation.
5. Try installing the library via pip again.

loud carbon
#

Weird, I think I did that with Rust already

#

but okay

#

I'll try that

#

I need to restart right

full sail
modest tendon
#

Right, but I thought a fresh install might help it's build issue

full sail
#

This looks a bit to me like the classical issue where the Python version (3.13) is too recent for certain PyPi packages to have proper support for it yet.

#

This especially happens with SciPy a and related packages a lot.

modest tendon
#

Oh wow. matplotlib isn't supporting 3.13 yet

#

!pypi matplotlib

ornate cometBOT
modest tendon
#

Looks like the only option is to downgrade to 3.12 then

full sail
#

Well, there you go.

loud carbon
#

Huh okay

#

How do I run commands with 3.12 without uninstalling 3.13

#

or I have to do that

modest tendon
#

Well since you are working with venvs, you can create a venv with 3.12

loud carbon
#

Oh I see yeah

#

That's neat

#

Didn't know it'd give me the option to do that

full sail
#

You'll either have to make sure 3.12 is in PATH when installing it, which will make it essentially your default version, or you'll have to specify the entire path to 3.12's interpreter executable when creating a venv.

loud carbon
#

Heyy it worked

full sail
#

However, in Windows, the default app to open .py files with may still be 3.13 unless you make sure it's not, which can lead to surprises if you forget you did this.

full sail
#

I don't know what context this is, but glad it works for you.

modest tendon
#

Looks like just selecting what interpreter to use in VS Code

#

(which isn't the same as creating and activating a venv)

loud carbon
#

That's what pops up after I try to create a venv

#

but either way, thank you, it works

ornate cometBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.