Following your above suggestion about a different way to try running the file, I get two different responses depending on which one I run:
/usr/share/weewx $ python user/byows_rpi.py
Traceback (most recent call last):
File "/usr/share/weewx/user/byows_rpi.py", line 34, in <module>
import weewx.drivers
ModuleNotFoundError: No module named 'weewx'
and
/usr/share/weewx $ python -m user.byows_rpi
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/usr/share/weewx/user/byows_rpi.py", line 335, in <module>
station = ByowsRpiStation()
File "/usr/share/weewx/user/byows_rpi.py", line 113, in __init__
self.bme280_sensor.load_calibration_params(self.bme280_bus, self.bme280_address)
File "/usr/local/lib/python3.9/dist-packages/bme280/__init__.py", line 154, in load_calibration_params
compensation_params.dig_T1 = read.unsigned_short(0x88)
File "/usr/local/lib/python3.9/dist-packages/bme280/reader.py", line 40, in unsigned_short
return self._bus.read_word_data(self._address, register) & 0xffff
File "/usr/local/lib/python3.9/dist-packages/smbus2/smbus2.py", line 470, in read_word_data
self._set_address(i2c_addr, force=force)
File "/usr/local/lib/python3.9/dist-packages/smbus2/smbus2.py", line 354, in _set_address
ioctl(self.fd, I2C_SLAVE, address)
TypeError: argument must be an int, or have a fileno() method.