/ / ImportError: बोतल नाम का कोई मॉड्यूल नहीं - WSGI + अजगर + अपाचे - अजगर, Apache, अमेज़न-वेब-सेवाएँ, amazon-ec2, बोतल

ImportError: बोतल नामक कोई मॉड्यूल नहीं - WSGI + पायथन + अपाचे - पायथन, अपाचे, अमेज़ॅन-वेब-सेवाएं, अमेज़ॅन-ec2, बोतल

मैं WSGI के माध्यम से अपने अपाचे अमेज़ॅन EC2 सर्वर पर एक बोतल ऐप चलाने की कोशिश कर रहा हूं, और मुझे यह त्रुटि मिलती रहती है:

[Fri Aug 12 06:15:13 2016] [error] [client 72.219.147.5]   File "/var/www/html/lumos/app.wsgi", line 5, in <module>
[Fri Aug 12 06:15:13 2016] [error] [client 72.219.147.5]     import bottle
[Fri Aug 12 06:15:13 2016] [error] [client 72.219.147.5] ImportError: No module named bottle

जब मैंने mod_wsgi स्थापित किया था, तो इसका उपयोग किया गया था:

mod_wsgi-python26-3.2-6.11.amzn1.x86_64

यहाँ मेरी appgi फ़ाइल है

import os, sys

sys.path.insert(0, "/var/www/html/lumos")

import bottle
import app

application = bottle.default_app()

यहाँ मेरा httpd.conf है:

WSGISocketPrefix /var/run/wsgi

<VirtualHost *>
ServerName lumos.website.me
DocumentRoot /var/www/html/lumos

WSGIDaemonProcess lumos threads=5
WSGIScriptAlias / /var/www/html/lumos/app.wsgi
<Directory "/var/www/html/lumos">
WSGIProcessGroup lumos
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</VirtualHost>

यहाँ WSGI का संस्करण है (मेरी त्रुटि लॉग से):

[Fri Aug 12 06:15:11 2016] [notice] Apache/2.2.31 (Unix) DAV/2 PHP/5.3.29 mod_wsgi/3.2 Python/2.6.9 configured -- resuming normal operations

लेकिन अगर मैं दौड़ता हूं python -V, मुझे मिला Python 2.7.10.

मुझे यह भी पता है कि बोतल सही ढंग से स्थापित है क्योंकि जब मैं निम्नलिखित कार्य करता हूं, तो कोई त्रुटि नहीं है:

$ python
>>>import bottle #no import error
>>>

अद्यतन करें:

मैंने यह देखने के लिए "हेल्लो वर्ल्ड" टेस्ट करने की कोशिश की कि क्या wsgi काम कर रही है:

def application(environ, start_response):
status = "200 OK"
output = "Hello World!"

response_headers = [("Content-type", "text/plain"),
("Content-Length", str(len(output)))]

start_response(status, response_headers)

return [output]

यह काम किया है, इसलिए समस्या WSGI नहीं है।

यह मेरी app.py फ़ाइल के अंदर है:

from bottle import route, run, template, static_file, request
import main


template = """<html>
<head><title>Home</title></head>
<body>
<h1>Upload a file</h1>
<form action="/upload" method="post" enctype="multipart/form-data">
Category:      <input type="text" name="category" />
Select a file: <input type="file" name="upload1" />
Select a file: <input type="file" name="upload2" />
<input type="submit" value="Start upload" />
</form>
</body>
</html>"""


@route("/")
def index():
return template

अगर मैं अमल करता हूं python app.py, कोई त्रुटि नहीं है। यह सिर्फ जब मैं lumos.website.me ताज़ा करता हूं कि 500 ​​त्रुटि है

किसी भी मदद की सराहना की है।

उत्तर:

जवाब के लिए 0 № 1

अपनी निर्देशिका से बोतल को अनइंस्टॉल करने की कोशिश करें और फिर cmd खोलें और इसे एडमिनिस्ट्रेटर के रूप में चलाएं और बोतल को टाइप करें और अपने आप को देखें ...

   Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:WINDOWSsystem32>pip install bottle
Collecting bottle
Using cached bottle-0.12.9.tar.gz
Building wheels for collected packages: bottle
Running setup.py bdist_wheel for bottle ... done
Stored in directory: C:UsershkpraAppDataLocalpipCachewheels6e8789f7ddd6721f4a208d44f2dac02f281b2403a314dd735d2b0e61
Successfully built bottle
Installing collected packages: bottle
Successfully installed bottle-0.12.9