Help with TrueNAS install, 'env: python: no such file or directory'

161 views
Skip to first unread message

Evan Kimberly

unread,
Sep 22, 2021, 12:17:37 AM9/22/21
to weewx-user
I am still learning my way around bsd and command line in general and am having difficulty getting this up and running. I was reading a separate thread in this group 'FreeBSD / TrueNAS Jail Install Help' and am now stuck.

My current steps as follow:
Set up jail (In TrueNAS, 12.2-RELEASE-p9)
pkg install python38
pkg install py38-cheetah3
pkg install py38-configobj
pkg install py38-pillow
pkg install py38-sqlite3
pkg install py38-ephem
tar xvfz weewx-4.5.1.tar.gz
cd weewx-4.5.1
./setup.py build

I get the title error at the last step. I am currently in the directory that setup.py exists in. The thread I was following suggested using python37, but I wasn't able to install those packages. When I run pkg search py37-(whatever) I don't get any results, so i changed up to 38.

Any suggestions?

vince

unread,
Sep 22, 2021, 12:40:37 AM9/22/21
to weewx-user
Try "python3 setup.py build" and see if that works any better.

Basically your system does not have a default "python", which we see in some operating systems.

Evan Kimberly

unread,
Sep 22, 2021, 9:50:04 AM9/22/21
to weewx-user
I just tried that and it is telling me python3 command not found.

Doug Jenkins

unread,
Sep 22, 2021, 10:16:42 AM9/22/21
to weewx-user
Evan:

In your jail you will need to install python3 and the packaging through pkg first. You will need to find the FreeBSD equivalents of the required packages as listed in the setup doc (  WeeWX: Installation using setup.py) . 

Keep in mind that jails usually do not have access to the direct hardware, so USB/serial passthrough maybe tough.

It may make sense to setup a VM of Debian Buster on TrueNAS than trying to run this through a jail. WeeWx does not need a lot of resources, so a small VM (2GB, 2 cores) could be sufficient.

DDJ



Evan Kimberly

unread,
Sep 22, 2021, 10:26:40 AM9/22/21
to weewx-user
I tried writing a line in make.conf to point to python 3.8

PYTHON_DEFAULT_VERSION='python3.8'

No luck still getting it to run.

As for hardware access, i plan on using interceptor. From what I've read on here, it sounds doable to run weewx in a jail on freebsd. I just need to get the thing installed first!

Doug Jenkins

unread,
Sep 22, 2021, 10:48:33 AM9/22/21
to weewx-user
Ok, that helps a bit. 

I have created a jail on my TrueNAS (v12.0.U05) and I will try to get WeeWX to work with a simulator first. My Jail will be based on FreeBSD 12.2

The challenge is getting dependencies installed in Python. I was able to get Python3 installed and configured by running the following statement in my new jail:

pkg install python3.

I will take a look at this in the afternoon and see if I am successful. If so, I will share the details.

DDJ

Doug Jenkins

unread,
Sep 22, 2021, 5:27:13 PM9/22/21
to weewx-user

Evan:

I got WeeWX to work in a TrueNAS jail today. I was able to set it up with the simulator driver and ran it from the command line (./bin/weewxd + ./bin/wee_reports) with no issues. This setup assumes you are going to use the sqlite database as your datasource.  I will list the instructions below this note.

One thing I noticed on your original thread is that you need to do a symbolic link for python3 to python. so I ran this statement below after my package installation to ease my install:

ln -s /usr/local/bin/python3 /usr/local/bin/python.

Here is the steps I did to get this to work.

===== WEEWX FREEBSD INSTALL INSTRUCTIONS =====
1. Install these packages:

pkg install python3
pkg install py38-pip
pkg install py38-configobj
pkg install py38-pillow
pkg install py38-pyserial
pkg install py38-pyusb
pkg install py38-cheetah3
pkg install py38-sqlite3
pkg install py38-mysqlclient
pkg install py38-ephem

2. create symbolic link for python3 to python
ln -s /usr/local/bin/python3 /usr/local/bin/python

3. Grab weewx and decompress it in your home folder. In this example below, we are going to get WeeWX 4.5.1

tar xvfz weewx-4.5.1.tar.gz
cd weewx-4.5.1
./setup.py build
./setup.py install

4. Follow the installation prompts to configure your weewx.conf file.

5. Test out your installation by running these commands in the /home/weewx directory:

./bin/weewxd
./bin/wee_reports

6. Validate you have a /home/weewx/archive/weewx.sdb file and html files located in /home/weewx/public_html directories.

===== END FREEBSD WEEWX INSTALL INSTRUCTIONS =====

let us know how you make out with this setup and if you need any more help.

DDJ

Evan Kimberly

unread,
Sep 22, 2021, 11:40:31 PM9/22/21
to weewx-user
Hi Doug,

Thank you so much! That did the trick! I think it must have been the linking Python3 to to Python that I was missing. I really appreciate it!

I am in the middle of doing initial setup on the station now. I'll have to come back to interceptor and webserver tomorrow.

Thanks!

matthew wall

unread,
Sep 23, 2021, 9:39:37 AM9/23/21
to weewx-user
instead of doing the symlink, you should be able to do this:

/usr/local/bin/python3 setup.py build
/usr/local/bin/python3 setup.py install

when you use setup.py to build and install, it modifies the shebang line of each entry point to refer to whatever python you used to invoke it.  so whatever ends up in /home/weewx (or wherever you installed weewx) has a shebang bespoke to your system.

the reason we have the 'env python' shebang is to make the weewx entry points as generic as possible (in particular, not specific to how things happen to be done on the latest linux release).  that lets you run weewx directly from the source tree without modifying any python code just to use a specific python interpreter.

m


On Wednesday, September 22, 2021 at 5:27:13 PM UTC-4 do...@dougjenkins.com wrote:

Doug Jenkins

unread,
Sep 23, 2021, 6:19:40 PM9/23/21
to weewx-user
Matt:

So I stand corrected :) 

I tried your suggestion in another TrueNAS FreeBSD 12.2 jail and it worked. I checked the final weewxd and wee_reports files in /home/weewx/bin and their shebangs were set to #!/usr/local/bin/python3 as you indicated. 

Evan:  You may want to revise your install process to skip the symbolic link.

for this procedure Matt, should there be an update to the setup documentation ( http://weewx.com/docs/setup.htm ) for those users that use FreeBSD? If there is a github repository for the setup documentation, I am willing to make the changes and send in a PR for you all to review. If there is another place where this procedure should go, please advise.

Just let me know if you need my assistance.

DDJ



vince

unread,
Sep 23, 2021, 6:55:36 PM9/23/21
to weewx-user
On Thursday, September 23, 2021 at 3:19:40 PM UTC-7 do...@dougjenkins.com wrote:
should there be an update to the setup documentation ( http://weewx.com/docs/setup.htm ) for those users that use FreeBSD? If there is a github repository for the setup documentation, I am willing to make the changes and send in a PR for you all to review. If there is another place where this procedure should go, please advise.



Quick look seems to say you'd want to use the 'docs' subdirectory of the development branch (https://github.com/weewx/weewx/tree/development/docs) and create a freebsd.htm file and link it into readme.htm and setup.htm, but there are likely other places in the docs tree to add info to as well.

Evan Kimberly

unread,
Sep 23, 2021, 7:37:58 PM9/23/21
to weewx-user
Hi Matt and Doug,

Yes I was thinking I'd try that out and see how it went! Thanks for the tips!
Reply all
Reply to author
Forward
0 new messages