Ok, first I installed meson version 0.37.1 but then I realised I couldnt do ninja command. So I wanted to upgrade to upper version 0.40, in my case 0.42. So I just runned the pip3 command and installed meson 0.42, but when I want to use the programm it says the version is still 0.37.1. How can I fix this? Thanks
[Im on Raspbian]
Did you run pip3 install --upgrade meson ?
Maybe ~/.local/bin isn't in PATH.
run which meson to see where is old meson, uninstall it.
For example: on ubuntu:
sudo apt-get remove meson
and then reopen terminal.
pip3 whill install meson to /usr/local/bin/meson, but some machine, the /usr/bin is before /usr/local/bin in $PATH
Note that you should prefer using pip3 install --user meson to avoid needing root, and ensure ~/.local/bin is at the front of PATH.
liugang's procedure worked for me wit a similar problem. Thank you!
A note to mac users: pip3 uninstall meson only uninstalls meson in the python3's meson directory. Another directory, like that in /usr/local/bin/meson may still contain meson.
To uninstall or update meson for quick command-line use, you should first make sure you've done xcode-select --install for more command line developer tools if you haven't already (so that there won't be any errors thrown in brew installs.) Then, you have 2 brew-related options:
brew uninstall meson and to reinstall it brew install meson (time consuming)brew upgrade meson (less time consuming)Then make sure brew link meson has been done.
Hope that saves another person some time.
My install still checked for it being in /usr/bin
I just made a symlink .
ln -s /home/username/.local/bin/meson /usr/bin/meson
This is not a meson bug, folks. It's how pip works and after installing with pip3 install --user it even tells you if ~/.local/bin is not in PATH. We even document it: https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip
Closing.
@nirbheek you didn't document how to fix it though.
And why do we need to install through pip? apt is easier and more convenient.
The only problem with apt is its not updated.
Most helpful comment
run
which mesonto see where is old meson, uninstall it.For example: on ubuntu:
and then reopen terminal.
pip3 whill install meson to /usr/local/bin/meson, but some machine, the
/usr/binis before/usr/local/binin$PATH