Closed philmurp closed 2 years ago
HI @philmurp, one thing to check if it is a permission error is to first make sure the file is indeed in the correct position and the environment variable is properly set. You can check if the environment variable is set by running:
sudo su
echo $CAIT_WEB_PATH
This should show you a path where the system thinks the wsgi.py is located. Then please make sure the file is really there. If it is, then it could be the permission issue you found. We can continue from there. But if it isn't, then it is still a setup process issue.
File is present at the path specified; and my permissioning looks fine.
I am stumped on this one, some users online said could be python isnt in the same directory; not sure how that works I didnt do anything unique when downloading. I also made chmod command on the wsgi.py just in case but no help there.
So when I navigate to this path; and run it manually I get permission denied error:
Then with Sudo it runs but there is other error of TypeError
Hi @philmurp, the cait_webapp service uses root to run the webserver from the wsgi.py script, you would need to use sudo python3 wsgi.py
to test if that is working.
Not file found with that code:
Oh sorry @philmurp, I missed that you have used sudo in one of your screenshots. The error seems to be indicating that there are some API inconsistencies between the Python version in your system and the Python version CEP was written in. In Raspberry Pi OS (bullseye), the Python version is 3.9.2. While in your system, you are using Python 3.6. You may want to update the Python in your system to at least 3.9 and test again.
I upgraded to 3.9.11. Also aliased both python and python3 = python3.9. Which worked based on picture below.
Same error: ![Uploading Capture.PNG…]()
New error when I navigate to the file and then run it:
Hi @philmurp, can you confirm if the python3 version in root is also upgraded to 3.9? You can check by running
sudo su
python3 --version
Regarding the new error, this is because the setup process was run with the previously installed Python 3.6 version, therefore, all of the necessary packages were installed for Python 3.6 only. You may need to do the setup again in the following order:
Ah the sudo su, then python3 --version = 3.6.9.
Any idea how to fix that? I guess my alias in .bashrc isnt applied in root.
The quick way is to perform the alias operation you did before, but this time, do it under the root account:
sudo su
<perform python alias>
Nice ok I got it to be 3.9.11 after I go to root. And now if I try to run wsgi.py manually, I get error no module names markupsafe.
So sounds like I need to perform a fresh re-install with python3.9 installed beforehand
Yup, hope that solves your issues.
So installed with no errors but same issue once I reboot:
Does the beginning of the install indicate anything to you? This always comes up prior to installing everything:
Hi @philmurp, for the first screenshot, it seems the Python packages weren’t correctly installed for the Python 3.9 that you installed. For the second screenshot, you don’t need to run the setup using sudo. You can just run bash setup.sh
.
Not sure what went wrong with the Python3.9 install; I still dont know why it cant find the wsgi.py under normal conditions but then I can navigate there and run it.
Are you saying python3.9 didnt install correctly because once I get to wsgi.py it shows "flask" missing?
Given there are so many dependencies I might need to fix, I found this online Armbian.
Seems like its Debian style OS that can be used on ARM boards like Jetson Nano. Any thoughts on if its worth a shot?
docs.armbian.com/User-Guide_Getting-Started/
I would say if the latest Armbian operating system is based on the latest Debian (Bullseye), there should be less dependency issues. And since it is a system closer than the latest Raspberry Pi OS, it may worth a try.
Any chance me installing in the "git checkout dev" branch is causing issues?
The dev branch's setup script is the same as the main branch. Since the problem happens during the setup process, it is not likely that was caused by the dev branch.
Yeah not sure where its going wrong; the initial problem of python3: cant open file 'wsgi.py' : [Errno 2] No such file or directory is confusing me because the path is correct and I can clearly get to it.
Feel like I am somehow in a different directory or something.
One thing in the below, it looks like my Python is in /usr/bin/python3 while my bash is in /bin/bash. Looking into if that means anything that the bash doesnt have /usr but Python does
Some more interesting findings: I see in root root looks like maybe it is python2.7 still.
Perhaps I have to run code "sudo su" before all my installs/tweaks to ensure at root python is installed?
I think for Linux, the root/default Python version is closely related to the operating system. So there is a chance that the operating system you are using needs an upgrade in order to use Python 3.9 as the root/default Python. Or you may even need to use other Linux distros that come with a newer Python version.
The last screenshot you showed did suggest the root python3 still points to the 3.6 version though, which means the linking you did wasn't working for the root.
But I am aliasing python3 -> python3.9; so it should be running python3.9 whenever called like that.
I think because my last screenshot I was opening the actual python3 folder so it shows python 3.6 but if the aliasing is working properly that version should never get used
You can check which python3 is being used by running which python3
in both the user account and root account (after sudo su
). This way you can confirm if the alias is working.
I found this page: https://www.itsupportwale.com/blog/how-to-upgrade-to-python-3-9-0-on-ubuntu-18-04-lts/ with some steps after install to update alternatives, maybe that will be better than alias.
That at least changed the error, so maybe I will reinstall from scratch again:
Yes, it looks like the default python version is 3.9.11 now. If this method is used before the setup process, then all packages installed during the setup process should be done with Python 3.9 then.
Good news the install for sure used Pyhton3.9 because a lot more modules were being downloaded.
Bad news, some more errors. I am looking through fixing them:
/usr/bin/aarch64-linux-gnu-gcc error: No Python.h file or directory came up about 4 times: Online I see I should download the dev version of Python: sudo apt install libpython3.9-dev, so I will try this.
Not sure about this error; when building wheel for opencv-contrib-python: Maybe this is Ninja related like the below?
OpenCV install error: Cant find Ninja: Going to try and download the Ninja tool
Could not find python2, seems online I can ignore this warning.
Fixed above, re-ran setup but still back to same error of cant find wsgi,py and when I manually navigate flask is missing.
Going to start from scratch again with the new python3.9-dev install before initial setup run to test again.
Python2 should be installed already within the operating system you are using, so that's a weird error. But you are right to install the python3.9-dev package for the missing Python.h error. And the fact that there is only the Python error during the OpenCV installation/compilation process is a good sign, meaning all of the other OpenCV dependencies were installed.
Still same cant direct to file error. I think it must be something due to my $PATH vs SUDO environment or something. Just cant figure this out
Hi @philmurp, in the setup script, starting at this line, it adds the corresponding paths to the environmental variables to the root environment. The only reason I can think of for your issue is that these lines were being executed, or they were not suitable for your operating system. You can investigate a bit into this to make sure the path was added correctly during the setup process by these lines.
Hello, I tried installing with Armbian image on the Jetson Nano; same error as before:
Note: I installed as root first since that was default, then once it reset it brought me to my user profile so after checking it didnt work I installed again not in root. That is second picture.
After installing only in root:
After installing in user profile:
Trying to run WSGI manually:
Hello, any alternative to Raspberry Pi 4? Still cant find any in stock.
I am using VMWare Workstation since I dont have a Pi 4 and they are very hard to come by right now. I am running latest Pi OS; was able to download the CEP packages with success and Desktop rebooted.
I am able to SSH into the Pi so I believe that confirms we are on the same LAN and able to access the Pi. However, every time I run:
http://<raspberry_pi_hostname>.local/setup
I get an error "Connection was Reset". Tried on Chrome and Edge browsers. Any idea why I cant access the setup site, do I need to run any commands on the Pi desktop to trigger it to act like server?
Thanks!