Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modulenotfound error after install in Raspberry Pi OS Lite kernel 5.15 #61

Open
linxcow opened this issue Apr 16, 2023 · 1 comment
Open
Assignees
Labels
documentation Related to the documentation

Comments

@linxcow
Copy link

linxcow commented Apr 16, 2023

I used the method described in the online help to install using pip3

I set the wifi card in monitor mode ( checked using iw wlan info)

after launching i get following messages

pi@raspberrypi:~/.local/bin $ sudo ./probequest wlan0
Traceback (most recent call last):
  File "/home/pi/.local/bin/./probequest", line 5, in <module>
    from probequest.cli import main
 ModuleNotFoundError: No module named 'probequest'

platform Python 3.9

>>> print(os.sys.path)
['', '/usr/lib/python39.zip', '/usr/lib/python3.9', '/usr/lib/python3.9/lib-dynload', '/home/pi/.local/lib/python3.9/site-packages', '/usr/local/lib/python3.9/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.9/dist-packages']
@linxcow linxcow added the bug New bug label Apr 16, 2023
@linxcow linxcow changed the title Modulenotffound error after install in Raspberry Pi OS Lite kernel 5.15 Modulenotfound error after install in Raspberry Pi OS Lite kernel 5.15 Apr 16, 2023
@SkypLabs
Copy link
Owner

Hi @linxcow,

Thanks for reporting this. It made me realise that the documentation is not clear enough.

Indeed, when installing ProbeQuest via pip3 install --upgrade probequest, the entry point is placed in ~/.local/bin/probequest (/home/pi/.local/bin/probequest in your case), and the Python modules in ~/.local/lib. The problem comes from the fact that ProbeQuest requires root privileges to sniff raw Wi-Fi packets, and that the Python interpreter cannot locate ProbeQuest's dependencies when run with a different user than the one used to install ProbeQuest.

In a previous version of the documentation, users were instructed to install ProbeQuest with the root user via sudo pip3 install --upgrade probequest, but this was a bad practice as it "may interfere with the operation of the system package manager and other components of the system if a component is unexpectedly upgraded using pip" as stated in the Python documentation. This is why I removed the "sudo" prefix from the installation command-line in the documentation but I forgot to update the rest of the instructions.

From the top of my head, I can see two workarounds:

  1. Manually specify the location of ProbeQuest's dependencies via the PYTHONPATH environment variable: sudo PYTHONPATH=/home/pi/.local/lib/python3.9/site-packages/ /home/pi/.local/bin/probequest
  2. Use a dedicated virtual environment:
    # Create a new virtual environment.
    python -m venv .probequest-venv
    
    # Enter the virtual environment.
    source .probequest-venv/bin/activate
    
    # Install ProbeQuest inside the virtual environment.
    pip install probequest
    
    # Leave the virtual environment.
    deactivate
    
    # Run ProbeQuest installed inside the virtual environment via sudo.
    sudo .probequest-venv/bin/probequest

I acknowledge that this is not ideal but I will try to find a better way. In all cases, I will update the installation instructions in the documentation.

@SkypLabs SkypLabs added documentation Related to the documentation and removed bug New bug labels Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants