简体   繁体   English

无法在 python3.6 上安装 oppiamobile

[英]unable to install oppiamobile on python3.6

I have a server withUbuntu16.04, running on a ec2 m5.large instance with python3.5 and python3.6 both installed.我有一台带有 Ubuntu16.04 的服务器,在安装了 python3.5 和 python3.6 的 ec2 m5.large 实例上运行。

My data goes我的数据去了

ubuntu@myhost:~/oppia$ python3 --version
Python 3.6.3

This runs perfectly on python manage.py runserver output这在python manage.py runserver output 上完美运行

(env) ubuntu@myhost:~/oppia/django-oppia$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
July 23, 2020 - 13:23:04
Django version 2.2.13, using settings 'oppiamobile.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

/etc/apache2/apache2.conf has this configuration /etc/apache2/apache2.conf有这个配置

<VirtualHost *:89>
        ServerName my.host.com
        WSGIDaemonProcess localhost.oppia python-path=/home/ubuntu/oppia/django-oppia:/home/ubuntu/oppia/env/lib/python3.6/site-packages
        WSGIProcessGroup localhost.oppia
        WSGIScriptAlias / /home/ubuntu/oppia/django-oppia/oppiamobile/wsgi.py
        WSGIPassAuthorization On
        <Directory /home/ubuntu/oppia/django-oppia/oppiamobile/>
                <Files wsgi.py>
                        Require all granted
                </Files>
        </Directory>
        Alias /media /home/ubuntu/oppia/media/
        <Directory "/home/ubuntu/oppia/media/">
                Options MultiViews FollowSymLinks
                AllowOverride None
                Require all granted
        </Directory>
        Alias /static /home/ubuntu/oppia/static/
        <Directory "/home/ubuntu/oppia/static/">
                Options MultiViews FollowSymLinks
                AllowOverride None
                Require all granted
        </Directory>
        LogLevel warn
        ErrorLog /var/log/apache2/oppia-error.log
        CustomLog /var/log/apache2/oppia-access.log combined
</VirtualHost>

However, the error says:但是,错误说:

==> /var/log/apache2/oppia-error.log <==
[Thu Jul 23 13:26:07.036985 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] mod_wsgi (pid=28987): Target WSGI script ‘/home/ubuntu/oppia/django-oppia/oppiamobile/wsgi.py’ cannot be loaded as Python module.
[Thu Jul 23 13:26:07.037039 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] mod_wsgi (pid=28987): Exception occurred processing WSGI script ‘/home/ubuntu/oppia/django-oppia/oppiamobile/wsgi.py’.
[Thu Jul 23 13:26:07.037257 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] Traceback (most recent call last):
[Thu Jul 23 13:26:07.037331 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] File “/home/ubuntu/oppia/django-oppia/oppiamobile/wsgi.py”, line 12, in
[Thu Jul 23 13:26:07.037341 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] from django.core.wsgi import get_wsgi_application
[Thu Jul 23 13:26:07.037350 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] File “/usr/local/lib/python3.5/dist-packages/django/core/wsgi.py”, line 2, in
[Thu Jul 23 13:26:07.037355 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] from django.core.handlers.wsgi import WSGIHandler
[Thu Jul 23 13:26:07.037364 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] File “/usr/local/lib/python3.5/dist-packages/django/core/handlers/wsgi.py”, line 6, in
[Thu Jul 23 13:26:07.037369 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] from django.core.handlers import base
[Thu Jul 23 13:26:07.037388 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] File “/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py”, line 8, in
[Thu Jul 23 13:26:07.037392 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] from django.urls import get_resolver, set_urlconf
[Thu Jul 23 13:26:07.037400 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] File “/usr/local/lib/python3.5/dist-packages/django/urls/init.py”, line 1, in
[Thu Jul 23 13:26:07.037404 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] from .base import (
[Thu Jul 23 13:26:07.037410 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] File “/usr/local/lib/python3.5/dist-packages/django/urls/base.py”, line 9, in
[Thu Jul 23 13:26:07.037414 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] from .exceptions import NoReverseMatch, Resolver404
[Thu Jul 23 13:26:07.037421 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] File “/usr/local/lib/python3.5/dist-packages/django/urls/exceptions.py”, line 1, in
[Thu Jul 23 13:26:07.037425 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] from django.http import Http404
[Thu Jul 23 13:26:07.037432 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] File “/usr/local/lib/python3.5/dist-packages/django/http/init.py”, line 2, in
[Thu Jul 23 13:26:07.037438 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] from django.http.request import (
[Thu Jul 23 13:26:07.037445 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] File “/usr/local/lib/python3.5/dist-packages/django/http/request.py”, line 10, in
[Thu Jul 23 13:26:07.037449 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] from django.core import signing
[Thu Jul 23 13:26:07.037456 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] File “/usr/local/lib/python3.5/dist-packages/django/core/signing.py”, line 45, in
[Thu Jul 23 13:26:07.037459 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] from django.utils.crypto import constant_time_compare, salted_hmac
[Thu Jul 23 13:26:07.037466 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] File “/usr/local/lib/python3.5/dist-packages/django/utils/crypto.py”, line 6, in
[Thu Jul 23 13:26:07.037470 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] import secrets
[Thu Jul 23 13:26:07.037489 2020] [wsgi:error] [pid 28987] [remote 103.69.247.73:17442] ImportError: No module named ‘secrets’

I am unable to figure out following things:我无法弄清楚以下事情:

  i) Why is apache pointing to 3.5 here /usr/local/lib/python3.5? Once this points to 3.6 , I believe ‘screts’ error will be gone.
    ii) Target WSGI script ‘/home/ubuntu/oppia/django-oppia/oppiamobile/wsgi.py’ cannot be loaded as Python module.

This is coming even when I have `wsgi` installed and could verify:

wsgi_module (shared) wsgi_module(共享)

Please advise.请指教。

@Satya, I assume this is the same issue that you posted in the Oppia Community site ( https://community.oppia-mobile.org/t/unable-to-connect-oppiamobile-with-apache2/111 ) and we got it resolved there. @Satya,我认为这与您在 Oppia 社区网站( https://community.oppia-mobile.org/t/unable-to-connect-oppiamobile-with-apache2/111 )中发布的问题相同,我们得到了它在那里解决了。

For reference the issue seems to be that Apache was still using Python 3.5, and the solution was to upgrade to Ubuntu 18.04, where the default python is 2.7 or 3.6 For reference the issue seems to be that Apache was still using Python 3.5, and the solution was to upgrade to Ubuntu 18.04, where the default python is 2.7 or 3.6

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM