FIWW, I'd just do it my way and explain why. Then it won't matter what
their startup files do.
This one is a bit unusual because weectl calls weewxd under the hood, so
not having your PATH set up before you call weectl means no go.
We've trained users for a decade to '*when in doubt use an absolute
pathname*' which has always worked before. Not any more it seems...
Using an absolute pathname:
~/.local/bin/weectl station create --driver weewx.drivers.simulator
--no-prompt
The configuration file will be created at
/home/vagrant/weewx-data/weewx.conf.
Traceback (most recent call last):
File "/home/vagrant/.local/bin/weectl", line 8, in <module>
sys.exit(main())
File "/home/vagrant/.local/lib/python3.10/site-packages/weectl.py", line
52, in main
namespace.func(namespace)
File
"/home/vagrant/.local/lib/python3.10/site-packages/weectllib/parse_station.py",
line 117, in create_station
weecfg.station_config.station_create(config_path=namespace.config,
File
"/home/vagrant/.local/lib/python3.10/site-packages/weecfg/station_config.py",
line 64, in station_create
config_config(config_path, dist_config_dict, weewx_root=weewx_root,
*args, **kwargs)
File
"/home/vagrant/.local/lib/python3.10/site-packages/weecfg/station_config.py",
line 104, in config_config
copy_util(config_path, config_dict)
File
"/home/vagrant/.local/lib/python3.10/site-packages/weecfg/station_config.py",
line 522, in copy_util
raise FileNotFoundError("Cannot find weewxd")
FileNotFoundError: Cannot find weewxd
FWIW, a very ugly way 'does' work:
$ PATH=~/.local/bin:$PATH weectl station create --driver
weewx.drivers.simulator --no-prompt
The configuration file will be created at
/home/vagrant/weewx-data/weewx.conf.
Suggestion - if you can alter weectl to realize weewxd is in the same
directory it's in, perhaps the good 'ol "*use an absolute pathname*" method
will still work and we won't have to do special training on this one.
As-is it's going to cause a lot of the 'command not found - what do I do'
things we get flooded with on the -user group.
On Monday, January 16, 2023 at 3:39:47 AM UTC-8 Tom Keffer wrote:
> On Sun, Jan 15, 2023 at 8:11 PM Vince Skahan <[email protected]> wrote:
>
>> WARNING: The scripts weectl and weewxd are installed in
>> '/home/vagrant/.local/bin' which is not on PATH.
>> Consider adding this directory to PATH or, if you prefer to suppress
>> this warning, use --no-warn-script-location.
>>
>> I worked around it with a quickie script for ubuntu 2204...
>>
>
> The reason you're getting a warning is that most .profiles look like this:
>
> if [ -d "$HOME/.local/bin" ] ; then
> PATH="$HOME/.local/bin:$PATH"
> fi
> With a virgin system there is no ~/.local/bin, so it's not put in your
> PATH. After installing WeeWX there is.
>
> We could tell people to "source .profile" if they get the error, but there
> are so many different combinations of .profile, .bashrc, .zsh, etc, that
> I'm reluctant to do that. I'll just include a warning in the pip install
> instructions.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-development/2f77dcb7-603e-4a01-8432-b74b4ceaf2c1n%40googlegroups.com.