You are not logged in.

#1 2021-01-13 14:44:49

OliviaB21
Member
Registered: 2021-01-13
Posts: 9

matplotlib module not found error

I used
sudo pacman -S python-matplotlib

to install matplotlib, however when i try importing it in python i get a 'modulenotfound' error. I considered trying it with pip (although I am aware using pip is a bad idea most of the time), but I'm having issues with pip too.
pip install --livi matplotlib
returns this:

Traceback (most recent call last):
  File "/usr/bin/pip", line 33, in <module>
    sys.exit(load_entry_point('pip==20.2.3', 'console_scripts', 'pip')())
  File "/usr/bin/pip", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.8/importlib/metadata.py", line 504, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.8/importlib/metadata.py", line 177, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: pip

I've tried uninstalling both of these things but, no luck. I'm quite new to arch so I don't know what else to try. Any ideas on how i can either fix pip and hopefully make it work that way/ install it using another method.

Thank you very much in advance

Last edited by OliviaB21 (2021-01-13 14:46:27)

Offline

#2 2021-01-13 14:49:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: matplotlib module not found error

Please post the complete error from the actual problem, not form pip (don't use pip, just use the pacman package).

Also post the output of each of the following in code tags:

type python
pacman -Qo /bin/python
python -V

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2021-01-13 15:40:18

OliviaB21
Member
Registered: 2021-01-13
Posts: 9

Re: matplotlib module not found error

python is /usr/bin/python
/usr/bin/python is owned by python 3.8.5-2
Python 3.8.5

and the actual error:
Traceback (most recent call last):
  File "/home/livi/NEA/ReportAlgorithm.py", line 4, in <module>
    import matplotlib
ModuleNotFoundError: No module named 'matplotlib'

thanks

Offline

#4 2021-01-13 15:45:47

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: matplotlib module not found error

Forum Rules wrote:

IF YOUR SYSTEM IS NOT UP TO DATE - YOU ARE DOING IT WRONG. pacman -Syu *BEFORE* POSTING


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2021-01-13 16:16:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: matplotlib module not found error

Even more importantly, don't do partial upgrades.  If you simply hadn't updated in some time, pacman would have reported the 404 error of trying to install a python-matplotlib that is no longer available on the mirrors.  The fact that you were able to even install it indicates that you synced the databases, but python remains old - hence you're doing partial upgrades.  But a proper upgrade is still the solution.

Last edited by Trilby (2021-01-13 16:17:06)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2021-01-13 16:46:25

OliviaB21
Member
Registered: 2021-01-13
Posts: 9

Re: matplotlib module not found error

Hey, i ran pacman -Syu, restarted and reinstalled matplotlib and i still get the same 'ModuleNotFoundError'

Offline

#7 2021-01-13 18:19:38

a821
Member
Registered: 2012-10-31
Posts: 381

Re: matplotlib module not found error

please post again the full output of the commands of post #2. Check you don't have anything weird in your PATH.

Offline

#8 2021-01-13 18:36:11

OliviaB21
Member
Registered: 2021-01-13
Posts: 9

Re: matplotlib module not found error

python is /usr/bin/python
/usr/bin/python is owned by python 3.8.5-2
Python 3.8.5

so the same as before.

 /usr/bin/python /home/livi/NEA/ReportAlgorithm.py
Traceback (most recent call last):
  File "/home/livi/NEA/ReportAlgorithm.py", line 4, in <module>
    import matplotlib
ModuleNotFoundError: No module named 'matplotlib' 

same error too

as for anything weird what would that include and how should I check
thank you

Offline

#9 2021-01-13 18:48:09

OliviaB21
Member
Registered: 2021-01-13
Posts: 9

Re: matplotlib module not found error

echo $PATH gives me

/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

not sure if this is useful

Offline

#10 2021-01-13 19:26:16

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: matplotlib module not found error

The Arch repos haven't had Python 3.8.5-2 for over 4 months now, your system is well out of date. Try changing your mirror, if that doesn't work then post the output of pacman-conf


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#11 2021-01-13 21:22:24

OliviaB21
Member
Registered: 2021-01-13
Posts: 9

Re: matplotlib module not found error

yep, changing my mirrors, changing my keyserver and refreshing them updated python.
which fixed my original issue, thanks

Offline

Board footer

Powered by FluxBB