Re: West not installing; Alternative ways to install? #west


Marc Herbert
 

Hi,

 

   I think the current Getting Started guide really underestimates the importance of "pip[3]".

 

The zephyr repo has about 100 Python scripts now and counting and pip plays an incredibly crucial role in "Getting Started", it's like magic... until something breaks. Then it's like: "What was this pip thing again and what did it change on my system? Wait, *all that*?" Happened to me and apparently Johnnie too.

 

On Linux the interactions between Python packages installed by the Operating System vs the --user ones installed in ~/.local/bin can be especially fun, e.g. https://lwn.net/Articles/591421/

 

Reading the current https://docs.zephyrproject.org/latest/getting_started/getting_started.html from the start, the very first mention of pip for Windows and MacOS is:

 

Bootstrap west

Install the bootstrapper for Zephyr’s command-line tool, West (Zephyr’s meta-tool) in a shell or cmd.exe prompt:

# Linux

pip3 install --user west

 

# macOS and Windows

pip3 install west

 

... and then a forward-reference to installing more dependencies with pip. Not a word about what pip even is; into the deep end. Of course pip can easily be Googled, however one purpose of a Getting Started guide is IMHO to explain the bare minimum about every new critical thing without having to research it.

 

To avoid the forward reference and give pip a bit more of the credit it deserves, I think most things pip should be in a new, short but very first "PIP" section, in the main page and before anything about west considering west needs pip. This new and "true" PIP section can then have a very short introduction briefly describing what is and emphasizing how important it is and a link to its (good!) home page https://pip.pypa.io/en/stable/ in case something goes wrong. Such a "promotion" would hopefully encourage new users to pay a bit more attention to pip and for instance not dismiss any warning from it.

 

The slimmed down "Python Dependencies" section found later could then be downgraded to a one-line subsection of "Set Up a tool[chain]".

 

My 2 cents while I still remember about my "getting started" experience - this sort of experience tends to fade away very quickly :-)

 

Marc

 

 

From: <users@...> on behalf of "Birch Jr, Johnnie L" <johnnie.l.birch.jr@...>
Date: Sunday, 17 February 2019 at 12:01
To: Marti Bolivar <marti@...>
Cc: "users@..." <users@...>
Subject: Re: [Zephyr-users] West not installing; Alternative ways to install? #west

 

Hi Marti, all,

 

Thanks for the reply. There was something corrupt related to my pip/python install. Seems multiple versions of pip3 were found where version check at the command line would show version 3.5.2 while printing the version from a python statement would show 19.0.2. Ultimately I used some combination of commands using easy_install3 to get it installed instead of using pip.

 

Thanks,
Johnnie

 

From: Marti Bolivar [mailto:marti@...]
Sent: Friday, February 15, 2019 6:39 PM
To: Birch Jr, Johnnie L <johnnie.l.birch.jr@...>
Cc: users@...
Subject: Re: [Zephyr-users] West not installing; Alternative ways to install? #west

 

Hi Johnnie,

 

You can run "pip3 show -f west" to see where west was installed. Please make sure that is on your PATH. On Linux that is likely to be ~/.local/bin or so.

 

Marti

On Fri, Feb 15, 2019, 7:23 PM <johnnie.l.birch.jr@... wrote:

Hi All,

Getting started with zephyr, wanting to flash on an arduino 101 board for some experimentation. My host system is Mint 18.1 based on Ubuntu 16.04. I've followed steps to install the SDK and I assume that is installed correctly. Now I am following steps to install west from here: https://docs.zephyrproject.org/latest/getting_started/getting_started.html#get-the-source-code  but this step:

# Linux
pip3 install --user west


does not seem to do what it is intended. It leads to what looks like a successful install: 

jlb6740@yshou-mint:~$ pip3 install --user west
Collecting west
  Using cached https://files.pythonhosted.org/packages/7d/f7/228d4ba20feb2e2041abb2892b459e3bb7ddbfff28cc5963fb3787c92c46/west-0.5.4-py3-none-any.whl
Collecting colorama (from west)
  Using cached https://files.pythonhosted.org/packages/4f/a6/728666f39bfff1719fc94c481890b2106837da9318031f71a8424b662e12/colorama-0.4.1-py2.py3-none-any.whl
Collecting pykwalify (from west)
  Using cached https://files.pythonhosted.org/packages/36/9f/612de8ca540bd24d604f544248c4c46e9db76f6ea5eb75fb4244da6ebbf0/pykwalify-1.7.0-py2.py3-none-any.whl
Collecting PyYAML (from west)
Collecting python-dateutil>=2.4.2 (from pykwalify->west)
  Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Collecting docopt>=0.6.2 (from pykwalify->west)
Collecting six>=1.5 (from python-dateutil>=2.4.2->pykwalify->west)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: colorama, six, python-dateutil, docopt, PyYAML, pykwalify, west
Successfully installed PyYAML-3.13 colorama-0.4.1 docopt-0.6.2 pykwalify-1.7.0 python-dateutil-2.8.0 six-1.10.0 west-0.5.4
You are using pip version 8.1.1, however version 19.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
jlb6740@yshou-mint:~$ westcos-tool ^C
jlb6740@yshou-mint:~/Downloads$ west --version
No command 'west' found, did you mean:
 Command 'test' from package 'coreutils' (main)
west: command not found
jlb6740@yshou-mint:~/Downloads$ 

 

but there is no "west" file to execute on my path. At the website for west the install command is slightly different:

pip3 install west


But again, nothing is found on my path. I tried to install the whl file, I also tried to install with sudo but nothing has given me an executable to move on to the next steps:

west init zephyrproject
cd zephyrproject
west update


What are some alternative ways to installing this west script? Even the "Using Zephyr with west" page seems to imply I will want it for flashing and debugging later so I assume this is not a step I should skip.

Thanks,
Johnnie

 

 

Join users@lists.zephyrproject.org to automatically receive all group messages.