You are not logged in.
Pages: 1
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
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
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
IF YOUR SYSTEM IS NOT UP TO DATE - YOU ARE DOING IT WRONG. pacman -Syu *BEFORE* POSTING
Offline
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
Hey, i ran pacman -Syu, restarted and reinstalled matplotlib and i still get the same 'ModuleNotFoundError'
Offline
please post again the full output of the commands of post #2. Check you don't have anything weird in your PATH.
Offline
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
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
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
Offline
yep, changing my mirrors, changing my keyserver and refreshing them updated python.
which fixed my original issue, thanks
Offline
Pages: 1