Lets see the following:

   - uname -a


   - which python
   - sudo which python


   - echo $PATH
   - sudo bash -c 'echo $PATH'


It looks like you're running a 64-bit os perhaps ?  Which one specifically ?

Other than some odd 32-bit vs. 64-bit thing happening, I can only conclude 
that you have multiple python3 instances installed and root's $PATH is 
picking up the wrong one unless the commands above return something really 
odd...

On Monday, April 24, 2023 at 3:21:01 PM UTC-7 Michael wrote:

> weewx@raspberrypi:~ $ dpkg -l | grep pcap
> ii  libpcap0.8:arm64                     1.10.0-2                         
> arm64        system interface for user-level packet capture
> ii  libpcap0.8-dev:arm64                 1.10.0-2                         
> arm64        development library and header files for libpcap0.8
> weewx@raspberrypi:~ $ pip3 list --verbose  | grep pcap
> pypcap            1.3.0     /home/weewx/.local/lib/python3.9/site-packages 
> pip
> weewx@raspberrypi:~ $ python3 -c 'import pcap'
> weewx@raspberrypi:~ $ sudo python3 -c 'import pcap'
> [sudo] password for weewx:
>
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> ModuleNotFoundError: No module named 'pcap'
>
> On Monday, April 24, 2023 at 3:14:33 PM UTC-7 vince wrote:
>
>> From a clean RaspiOS that works....
>>
>> pi@pi4jr:~ $ dpkg -l | grep pcap
>> ii  libpcap0.8:armhf                     1.10.0-2                         
>> armhf        system interface for user-level packet capture
>>
>> pi@pi4jr:~ $ pip3 list --verbose  | grep pcap
>> pypcap        1.3.0     /usr/local/lib/python3.9/dist-packages pip
>>
>> pi@pi4jr:~ $ python3 -c 'import pcap'
>> pi@pi4jr:~ $ echo $?
>> 0
>>
>> pi@pi4jr:~ $ sudo python3 -c 'import pcap'
>> pi@pi4jr:~ $ echo $?
>> 0
>>
>> On Monday, April 24, 2023 at 12:51:47 PM UTC-7 Michael wrote:
>>
>>> weewx@raspberrypi:/usr/share/weewx/user $ python --version
>>> Python 3.9.2
>>> weewx@raspberrypi:/usr/share/weewx/user $ python3 --version
>>> Python 3.9.2
>>> weewx@raspberrypi:/usr/share/weewx/user $ ^C
>>> weewx@raspberrypi:/usr/share/weewx/user $ sudo 
>>> PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/interceptor.py 
>>> --device=wu-client --mode=sniff --iface=eth0 --filter="src 192.168.50.9 and 
>>> dst port 80"
>>> Traceback (most recent call last):
>>>   File "/usr/share/weewx/user/interceptor.py", line 2671, in <module>
>>>     device = InterceptorDriver.DEVICE_TYPES.get(options.device_type)(
>>>   File "/usr/share/weewx/user/interceptor.py", line 728, in __init__
>>>     super(WUClient, self).__init__(
>>>   File "/usr/share/weewx/user/interceptor.py", line 427, in __init__
>>>     self._server = Consumer.SniffServer(
>>>   File "/usr/share/weewx/user/interceptor.py", line 466, in __init__
>>>     import pcap
>>> ModuleNotFoundError: No module named 'pcap'
>>> weewx@raspberrypi:/usr/share/weewx/user $
>>>
>>> On Monday, April 24, 2023 at 12:48:18 PM UTC-7 vince wrote:
>>>
>>>> Again, your python is messed up or you have python (2) and python3 
>>>> installed.
>>>>
>>>> This worked on a clean raspios.  Same as your command just with an 
>>>> absolute path to interceptor.py
>>>>
>>>> sudo PYTHONPATH=/usr/share/weewx python 
>>>> /usr/share/weewx/user/interceptor.py --device=wu-client --mode=sniff 
>>>> --iface=eth0 --filter="src 192.168.50.9 and dst port 80"
>>>>
>>>> Try 'python --version' to verify it reports the same thing as 'python3 
>>>> --version'.
>>>>
>>>>
>>>> On Monday, April 24, 2023 at 10:45:31 AM UTC-7 Michael wrote:
>>>>
>>>>> sudo PYTHONPATH=/usr/share/weewx python interceptor.py 
>>>>> --device=wu-client --mode=sniff --iface=eth0 --filter="src 192.168.50.9 
>>>>> and 
>>>>> dst port 80"
>>>>> Traceback (most recent call last):
>>>>>   File "/usr/share/weewx/user/interceptor.py", line 2671, in <module>
>>>>>     device = InterceptorDriver.DEVICE_TYPES.get(options.device_type)(
>>>>>   File "/usr/share/weewx/user/interceptor.py", line 728, in __init__
>>>>>     super(WUClient, self).__init__(
>>>>>   File "/usr/share/weewx/user/interceptor.py", line 427, in __init__
>>>>>     self._server = Consumer.SniffServer(
>>>>>   File "/usr/share/weewx/user/interceptor.py", line 466, in __init__
>>>>>     import pcap
>>>>> ModuleNotFoundError: No module named 'pcap'
>>>>>
>>>>> On Monday, April 24, 2023 at 10:36:39 AM UTC-7 vince wrote:
>>>>>
>>>>>> On Monday, April 24, 2023 at 9:34:36 AM UTC-7 Michael wrote:
>>>>>>
>>>>>> I am trying to install WeeWx on my Raspi with Interceptor with a 
>>>>>> WU-Client coming from 192.168.50.9.  So far I am ending up with the 
>>>>>> following error message when trying to run the driver directly and no 
>>>>>> results in WeeWx.  
>>>>>>
>>>>>> Activateing packet capture failed. Error returned by packet capture 
>>>>>> library was b'socket: Operation not permitted'
>>>>>>
>>>>>>
>>>>>> [...omitting waaaaay too many lines.....]
>>>>>>
>>>>>> Your last command was:
>>>>>>
>>>>>> weewx@raspberrypi:/usr/share/weewx/user $ PYTHONPATH=/usr/share/weewx 
>>>>>> python interceptor.py --device=wu-client --mode=sniff --iface=eth0 
>>>>>> --filter="src 192.168.50.9 and dst port 80"
>>>>>>
>>>>>> You need to do that as root. Preface that last command with sudo so 
>>>>>> it runs as root.
>>>>>>
>>>>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/6cb88017-af3e-4aab-853a-5a16b1e61919n%40googlegroups.com.

Reply via email to