Keywords: Django - AWS - Technical issue - Services (Apache, MariaDB, MySQL…)
bnsupport ID: 47e3c4ae-e3c4-ab89-b1d5-731b49874649
bndiagnostic output:
? Apache: Found possible issues
? Resources: Found possible issues
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
bndiagnostic failure reason: The suggested guides are not related with my issue
Description:
Hi.
(disclaimer for following is I’m more experienced with Windows thatn Linux)
I am releasing a website. Before I go public I need to install/import the paypalcheckoutsdk module. I’ve logged onto my Lightsail Shell (from the console) and run:
python3 -m pip install paypal-checkout-serversdk
All seemed to go well. But the webstie falls over when it runs once it tries to import the module, saying it can’t be found.
When I go onto the Shell’s Python3 instance and import it all is fine. So I started to think perhaps the wrong Python is being run by Apache mod_wsgi. So I put a line in my views.py code to log sys.executable to my db logs. And it says the executable being run is /usr/bin/python3. While the Apache error log seems to indicate the correct versions of Python is running as I’m getting an error reported there (that doesn’t seem initially connected to my main problem):
Traceback (most recent call last):
File "/opt/bitnami/python/lib/python3.8/site-packages/asgiref/local.py", line 96, in __del__
NameError: name 'TypeError' is not defined
[Thu Dec 30 07:12:06.294684 2021] [mpm_event:notice] [pid 22416:tid 139833577270144] AH00491: caught SIGTERM, shutting down
[Thu Dec 30 07:12:06.487310 2021] [mpm_event:notice] [pid 23247:tid 140101812063104] AH00489: Apache/2.4.51 (Unix) OpenSSL/1.1.1d mod_wsgi/4.7.1 Python/3.8 configured -- resuming normal operations
[Thu Dec 30 07:12:06.487401 2021] [core:notice] [pid 23247:tid 140101812063104] AH00094: Command line: '/opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf'
Which seems to indicate the correct Python edition. So I have two fixes I can see.
- Sort out why at runtime sys.executable is pointing to the other version of Python, and get it to switch to the correct version.
- Install paypal-checkout-serversdk on the other version of Python.
So with option 1 I don’t know how to tell it “Hey, Apache, you’re using the wrong version of Python at runtime, even though you’re initialising the correct version”.
With option 2, I tried to pip install for that version
sudo /usr/bin/python3 -m pip install paypal-checkout-serversdk
And as it sorts out the dependencies it errors on not having Rust installed properly. Which I tried to fix by reinstalling Rust, which still didn’t work.
I’m thinking the first option is the better one anyway, but am at a loss to tell Apache/wsgi that it’s actually using the wrong version.
Or is that Apache error in the log telling me something I need to know, only it seems unrelated…
Many thanks, and a happy New Year, to you who take the time to read my issue, and even help.