Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ERROR:root:Unhandled exception: No module named 'gevent.monkey' #2417
Step 1: Please describe your environment
Step 2: Describe the problem:
On Raspbian 10 with kernel 4.19.97-v7l+ i tried to "sudo apt update;sudo apt upgrade" and download https://github.com/HelloZeroNet/ZeroNet/archive/py3/ZeroNet-py3.tar.gz
$ sudo python3 -m pip install -r requirements.txt
Launch: python3 zeronet.py --help
$ sudo pip3 list|grep -i gevent
$ sudo apt list|grep -i monkey
$ sudo apt list|grep -i gevent
Please run this:
the output does not look like a directory, so while you mention init.py, i tried:
$ locate init.py|grep -i gevent
but i am using "python3 zeronet.py" command.
there is a list of all paths to init.py
$ locate gevent.py
do you have ideas on another commands to try?
I found the cause of this whole issue. The error mentioned in the first post appear only when i run "python3 zeronet.py --help" as a non root user. When i run as root, it works OK.
Zeronet files has access rights of a non root user (under which i attempt to run zeronet)
I found that i can allow any linux user to run python as root (maybe bad idea) like this:
I am not sure if you can influence the error displayed so it suggest there is issue with access rights.
If you execute
I have never seen error like this, so it should be linux-dist specific.
@HelloZeroNet here is update regarding this issue (only root/sudo can launch zeronet on Raspbian 10):
i see the same (correct) output/permissions regarding python packages as you, except:
so i tried "$ python3 -m pip uninstall gevent"
# sudo python3 -m pip show gevent
So not knowing the cause i uninstalled gevent and installed it again without --user switch.
What then worked (to prevent errors described in the first post of this ticket - running zeronet as non-root) is to SETUID /usr/bin/python:
I am thinking if you can influence the error displayed when launching ZN without sudo (first post of this issue) so it suggest there is issue with access rights or can the installation commands on readme.md include additional command to change permissions somehow?
What error did it gave to you?
Executing with sudo won't work, because that way it will install to /root/.local/ directory that is not readable by the user.
Alternatively you can copy the /root/.local/lib/python3.7/ directory to /home/youser/.local/lib/python3.7
$ python3 -m pip install gevent --user
i tried this, but do not know how to do it
$ python3 zeronet.py
so far what worked to run ZN as a not root and without sudo was SETUID (sudo chmod u+s /usr/bin/python3)
It assigned read permission to all users, but despite of that, zeronet launching continue to show gevent.monkey error (when launched as a non-root user and without sudo).
$ find /usr/local/lib/python3.7/dist-packages/ -type f -ls
$ sudo find /usr/local/lib/python3.7/dist-packages/ -type f -ls
$ $ stat /usr/local/lib/python3.7/dist-packages
Please try this as an user:
(optional) If you see distutils error when running
$ python3 -m pip
$ python3 get-pip.py --user
output (with errors) (pass word is: zz)
$ python3 -m pip install -r requirements.txt --user --ignore-installed
output (with errors) (pass word is: zz)
error: ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/home/nonrootuser/.local/include/python3.7m'
$ sudo ls -l /home/nonrootuser/.local/include/python3.7m && sudo stat /home/nonrootuser/.local/include/python3.7m
I changed the rights to match the user who is executing the command:
drwx------ 3 nonrootuser nonrootuser 4096 Feb 9 23:24 python3.7m
except the include parent directory:
but it still errored, then i chown also include and then command NOT errored due to that directory, but instead: Permission denied: '/usr/local/lib/python3.7/dist-packages/websocket_client-0.57.0.dist-info/METADATA'
but despite of that i am surprised to see zeronet start to work when launched as a non root user:
which is why this issue was created (ZN erroring when launched without sudo)... i do not know what fixed this and why this permission issue happened. If it was due to how python or its module was installed (prefixed by sudo or from su terminal). I think that Linux noob users do not know the consequences and it can be good to prevent this issue somehow. This is Raspbian 10.