Setup 5.x in a single folder as setup.py used to do

101 views
Skip to first unread message

Dan'l B

unread,
Oct 5, 2024, 8:21:19 PM10/5/24
to weewx-user
It seems to me I saw a comment that using a venv it is still possible to enable the setup to locate all weewx files in a single folder, as setup.py used to do.

I've looked through the wiki and docs and can't find anything.

Can this be done?

Graham Eddy

unread,
Oct 5, 2024, 8:37:51 PM10/5/24
to WeeWX User
stations are separate data (by definition) but can have shared code base e.g.
  ~weewx/venv/
  ~weewx/station1/
  ~weewx/station2/
⊣GE⊢

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/2f2773c1-db59-4e51-a64b-85c6aac6c109n%40googlegroups.com.

vince

unread,
Oct 5, 2024, 9:05:50 PM10/5/24
to weewx-user
A pip installation all goes in the $HOME directory of the user that ran pip, so it's all in one directory (/home/pi or whatever) that has two subdirectories underneath. 
  • $HOME/weewx-venv is where the code of core weewx goes (don't mess under there).
  • $HOME/weewx-data is where skins, installed extensions/services, the database(s) and any generated output files go (you 'can' edit under there)
The 'weewx-venv' name above is what the pip quickstart uses as a name for the venv. You can use whatever name there you want if desired.

Tom Keffer

unread,
Oct 6, 2024, 11:01:10 AM10/6/24
to weewx...@googlegroups.com
If you really want to recreate what setup.py did, you can try

pip install --target /home/weewx/bin weewx
python3 /home/weewx/bin/weectl.py station create /home/weewx

Normally, pip installs into the site-packages subdirectory of whatever instance of python you are using.  The first line tells pip to install into /home/weewx/bin instead. 

The second line says to create a new station under the directory /home/weewx. So the configuration file, skins, archive database, etc, will all be put in /home/weewx

The results will approximate an old setup.py install with a couple of differences:
1. Everything will be put in /home/weewx. That is, not just the weewx code, but also its dependencies.
2. The files weewxd.py and weectl.py are not executable. You have to give them as an argument to python3. For example,

    python3 /home/weewx/bin/weewxd.py /home/weewx/weewx.conf



--

Dan Hinckley

unread,
Oct 14, 2024, 11:01:41 PM10/14/24
to weewx...@googlegroups.com
Vince, Tom,

Thanks for the pointers. I am getting used to the VENV way of installing WeeWx so your advice was invaluable.

Reply all
Reply to author
Forward
0 new messages