Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Instructions are confusing to people not familiar with pip #1613

Closed
FreeApophis opened this issue Apr 12, 2017 · 24 comments
Closed

Comments

@FreeApophis
Copy link

FreeApophis commented Apr 12, 2017

I appreciate the idea of having a build system which does not suck. However the installation of this build sucks badly. After 2 Hours fiddling I still cannot run the meson command on windows and have a great deal of unnecessary knowledge about the python package manager before beeing able to run mason on debian.

I See this ticket as a starting point for help for others frustrated with the installation:

1.) Download

There are basically no instructions on how to install, a completley unnecessary link to the sources and incomplete instructions for a programming language installation and a packet manager.

The linux instructions are less then minimal and there is not a single word for Mac or Windows.

My Tip: Ignore the Download-Page its completley useless.

2.) Installation

After clicking into the documentation the "Quick Guide" or "Using Meson" is the only place which bothers to handle the installation, in just so many words.

2.1) Python...

I want to build C++ or C# - and obviously it is required to know python to use this build system.

There are installation instructions for ubuntu, which are incomplete too. Installing the python3 package does not install pip3.

pip3 install --user meson

answers with: command not found

Of course I can google and as a developer I can easily solve such problems after some reasearch, but it shows how much the instructions really suck. They are not only lacking, they are incomplete and misleading. And I lost now 2 hours of my time where I could have learned the syntax instead of fiddling with tools which are only a dependency.

On Windows it is even worse, I couldn't get pip running so far. And beeing able to cross-compile was the main reason I looked into this project. So far I am not impressed. But that was yesterday, and I thought linux probably is the better platform to start.

2.2) Paths...

After running:

pip3 install --user meson

I saw the installation successfully installing into ~/.local/lib/python3.4/site-packages/

-bash: meson: command not found

Now I got angry enough to write this Bug. I also found #465 which addresses the issue. The Problem BTW is. that the meson executable is placed in "~/.local/bin/meson" which is not in the PATH. There is actually a bug hanging for pip ( pypa/pip#3813 ) with exactly this issue.

So to install meson, I need to know know how to install python and a package manager which is not even mentioned besides a command which does not work, circumvent bugs for their package manager before finally beeing able to run it for the first time.

3.) Running

So we have meson running with

~/.local/bin/meson build

Meson encountered an error:
Could not detect Ninja v1.6 or newer

Debian is very stable, so this one was to be expected, even though I am running jessie.
Still, each step of the road was blocked, nothing worked out of the box. This is very frustrating.

OK build ninja from source and copy it to /usr/bin

wget <latest-ninja>
./configure.py --bootstrap
 sudo cp ninja /usr/bin/

At this point, I am not sure if anybody uses meson outside the Python-Ubuntu-Club.

BUT I got it at least working on debian. If anyone has better instructions for windows I will gladly try them.

After the installation, it works surprisingly smooth...

@msink
Copy link
Contributor

msink commented Apr 12, 2017

Works for me on windows (win7-64), without any issues.

  1. Install latest Python 3, check for correct installation:
C:\>python -VV
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]

C:\>where python
C:\Python36-x64\python.exe

C:\>where py
C:\Windows\py.exe

C:\>where pip3
C:\Python36-x64\Scripts\pip3.exe
  1. Install meson, check for correct installation:
C:\>pip3 install meson
Collecting meson
  Using cached meson-0.39.1.tar.gz
Installing collected packages: meson
  Running setup.py install for meson ... done
Successfully installed meson-0.39.1

C:\>meson --version
0.39.1

C:\>where meson
C:\Python36-x64\Scripts\meson.py

@nirbheek
Copy link
Member

@msink Python 3's pip is called pip on Windows. You might've renamed pip to pip3 manually. But everything else should work as you said if your Python installation is done correctly.

@msink
Copy link
Contributor

msink commented Apr 12, 2017

There are both pip and pip3:

C:\>where pip
C:\Python36-x64\Scripts\pip.exe

And even pip3.6:

C:\>where pip3.6
C:\Python36-x64\Scripts\pip3.6.exe

I didn't rename anything in python 3.6 directory :)
You probably mean python3 - there is no such file, if user not renamed it by hand.

@FreeApophis
Copy link
Author

OK I got it to run on Window 10 too, it actually was easier than on Debian:

The Python 3 installer has some very bad default settings, first you need to check

[ x ] Add Python to PATH

The default installation is only for the current user, and is installed into the App Directory. Even though you add Python to the PATH variable, after installing meson with pip3, meson will not be in the Path.

If you install to all users, (Advanced Tab on the installer) meson will be in the path, but you need a command Prompt with eleveated privileges to install meson.

Either way

pip3 install meson

will install meson correctly.

After installing Ninjna into a directory in the PATH everything seems to work. Probably because I have Visual Studio already Installed? Not sure what compiler it would use otherwise. However after python is installed correctly, it seems to work fine on windows.

Thanks for the heads up.

@nirbheek nirbheek changed the title Download and Installation Instructions terribly lacking Installation Instructions are confusing to people not familiar with pip Apr 18, 2017
@pvaibhav
Copy link

pvaibhav commented May 3, 2017

Does pip3 install meson also install the scripts in the tools/ folder? I was not able to find cmake2meson.py on my system.

@jpakkane
Copy link
Member

jpakkane commented May 3, 2017

It is not installed by the package, it is only available in the source repository. The reason for this is that it s not reliable enough to ship.

@ghost
Copy link

ghost commented Oct 22, 2017

I mostly (no longer) have build problems with meson as such; with ninja also not that much. But I miss some easy options, simply because I am so used to the GNU Autoconfigure way.

I give you an example. I just compiled dconf 0.27.1.

/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^~~~~~~
[90/90] Linking target tests/engine.

I got a warning... which I assume is no problem, but it is still confusing.

I see 90/90 and I also see bin/dconf.

I assume it has compiled successfully but ... do I have any --prefix option? Any "make" and "make install" step?

Probably somewhere. Meson/Ninja people who are so used to it, can figure out, but poor me doesn't really have any idea about this. So what I do now is to ... manually relocate bin/dconf to where it ought to reside. :\ :/

dconf is just one example, this by now probably applies to most of the gnome3 stack. Perhaps it is documented somewhere, but I'd wish that for the --prefix, "make" and "make install"-like steps, it would be super-trivial on the commandline. Just to get the equivalent options. (That also includes ./configure --help like options... cmake has a similar problem, it was hard to find out what options cmake wants... took me a while to find out that --prefix is equivalent to -DCMAKE_INSTALL_PREFIX= ... the rest is still guessing by me mostly, or trying to wait until the LFS/BLFS folks got the right options and just using it from them, then).

@TingPing
Copy link
Member

TingPing commented Oct 22, 2017

I assume it has compiled successfully but ... do I have any --prefix option?

Sure, meson builddir --prefix=/whatever or meson configure builddir -Dprefix=/whatever

Any "make" and "make install" step?

ninja was make and ninja install is make install.

@NickeZ
Copy link
Contributor

NickeZ commented Oct 23, 2017

I think the equivalent of ./configure --help is meson.py configure builddir. This will list the options available in the project. Then you can set them with -D or with meson configure.

@pwnlogs
Copy link

pwnlogs commented Oct 26, 2017

@FreeApophis ,
The fact that you had to use ~/.local/bin/meson is not really a problem of meson,
You should run pip3 with root privileges if you want to install it to root dir.
Try
sudo pip3 install meson

@SloCompTech
Copy link
Contributor

I agree with @JithinPavithran.
I recommend that this is added as note to install instructions.

@jhaagsma
Copy link

jhaagsma commented Apr 2, 2018

Thanks for this bug report, I wouldn't have figured out how to get this working otherwise!

@pcouderc12
Copy link

This is a very bad bug that you install following instructions :
pip3 install -- user meson
and you get :
/usr/bin/meson: No such file or directory

It is desperating.

@FreeApophis
Copy link
Author

FreeApophis commented Jul 16, 2018

This is not a bug:
You have a space between -- and user, that can't work.

@pcouderc12
Copy link

ok, sorry for the noise

@nirbheek
Copy link
Member

nirbheek commented Aug 7, 2018

Detailed instructions for how to install meson are now available at https://mesonbuild.com/Getting-meson.html and everything on this PR has been addressed there AFAIK.

Please open new issues for improving that as required. Thanks for all the input here.

@nirbheek nirbheek closed this as completed Aug 7, 2018
@sempasha
Copy link

@nirbheek there is one more document should be corrected https://mesonbuild.com/Quick-guide.html

@darkoverlordofdata
Copy link

This is still an issue, and you closed it without actuall fixing it.
the install instruction give you two methods:

pip3 install meson
pip3 install --use meson

The thing is, those both do the same thing. You have to use

sudo pip3 install meson

Otherwise, meson doesn't seem to work.

You're probably thinking that we should just know to use sudo, but that isn't the case.
I follow install insructions verbatim. Not all package managers require sudo - the on I use most,
npm, does bad thing if you use sudo. We are not all pyhonistas. Please fix your install instructions so that everyone can follow them.

@xclaesse
Copy link
Member

With --user you should not need sudo. Some details are really platform/distro specific, not all distro have sudo, not all distro has ~/.local in the $PATH by default... I don't think Meson doc can cover all possible cases. In most sane env, pip3 install --user meson should be enough.

@amfwaddi
Copy link

I completely commiserate with the OP.

I have downloaded meson-0.56.0: Successfully unpacked it: now, lookiing for INSTALL.txt, nope, ok README.md will do, right?

Not even close. README seems to contain information for installing prebuilt meson package using pip or ninja. Hrmm.

clearly, I'm trying to build meson from source; mesonbuild dir right? Nope needs a 'pristine' directory for that... Ok, I'm hip to the notion that you might need to bootstrap a build system.

So how do I build meson from source?
I've read all those not helpful install instructions.

@eli-schwartz
Copy link
Member

eli-schwartz commented Nov 17, 2020

https://mesonbuild.com/Getting-meson.html#downloading-meson

Meson releases can be downloaded from the GitHub release page, and you can run ./meson.py from inside a release or the git repository itself without doing anything special.

Seems pretty fair to me.

Other methods include:

  • "On Windows, use the .msi installer"
  • on Linux, it's reasonable to assume users can install meson using apt, rpm, pacman, emerge, or similar -- the distro package manager is a familiar, unified interface and meson's installation guide recommends you prefer it if available.
  • "some program named pip. If you don't have a program named pip, research how to acquire pip." But it comes out of the box on most python installs, and on linux distro installs, pip is available via, again, a distro package.
$ pkgfile -vb pip3
  extra/python-pip 20.1.1-1	/usr/bin/pip3
$ pip3
pip3 may be found in the following packages:
  extra/python-pip 20.1.1-1	/usr/bin/pip3

On debian:

$ apt-file search pip3
fish-common: /usr/share/fish/completions/pip3.fish
puppet: /usr/lib/ruby/vendor_ruby/puppet/provider/package/pip3.rb
python3-pip: /usr/bin/pip3
python3-pip: /usr/share/man/man1/pip3.1.gz
$ pip3

Command 'pip3' not found, but can be installed with:

apt install python3-pip


Not even close. README seems to contain information for installing prebuilt meson package using pip or ninja. Hrmm.

clearly, I'm trying to build meson from source; mesonbuild dir right? Nope needs a 'pristine' directory for that... Ok, I'm hip to the notion that you might need to bootstrap a build system.

What on earth is a "pristine" directory, and why do you think ./mesonbuild/ is it? I ask this as someone whose big thing is compiling and packaging hundreds of diverse projects for a linux distro.
I might think you're referring to "the original unmodified sources without the result of failed compilations", but then why are you looking in some random subdirectory for it? Most projects build from the root directory...

Once you do get pip installed...

$ pip install --help

Usage:   
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

Description:
  Install packages from:
  
  - PyPI (and other indexes) using requirement specifiers.
  - VCS project urls.
  - Local project directories.
  - Local or remote source archives.

Look at that, pip supports "Local project directories" via "pip install [options] [-e] ".

@eli-schwartz
Copy link
Member

I proposed to mention sudo pip install ./ in #7994 which should clarify this even more.

@DuaneNielsen
Copy link

DuaneNielsen commented Apr 22, 2022

Having just been through this, I feel I can safely say that the documentation fix does not really fix the user experience when installing via pip install.

If the goal is the best user experience, my 3 cents is, after "pip install meson", in any flavor, I should have the meson command in my path. Python offers a way to make make this happen via script. I implemented a working example of this here

Not suggesting it would be as easy to do as my simple little utility. Simply suggesting that effort should be spent in this area if the best UX is the goal. As the original poster states.. nothing turns off a user faster than having to do extra work on an install. In the ideal UX, installs should "just work".

Just my opinion. I love the concept and hope the project goes on to great success.

@eli-schwartz
Copy link
Member

eli-schwartz commented Apr 24, 2022

If the goal is the best user experience, my 3 cents is, after "pip install meson", in any flavor, I should have the meson command in my path. Python offers a way to make make this happen via script. I implemented a working example of this here

Not suggesting it would be as easy to do as my simple little utility. Simply suggesting that effort should be spent in this area if the best UX is the goal. As the original poster states.. nothing turns off a user faster than having to do extra work on an install. In the ideal UX, installs should "just work".

Meson already does exactly this:

meson/setup.cfg

Lines 37 to 39 in b78d33f

[options.entry_points]
console_scripts =
meson = mesonbuild.mesonmain:main

If you are still not getting the meson command in your path, then something has gone wrong somewhere (but this infrastructure belongs entirely to pip, not Meson.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests