Таким образом, я получаю следующую ошибку при запуске скрипта, который импортирует web
.
$ python bin/app.py
Traceback (most recent call last):
File "bin/app.py", line 1, in <module>
import web
ImportError: No module named web
Я пробовал использовать easy_install web
но получаю эту ошибку:
$ easy_install web
Searching for web
Reading http://pypi.python.org/simple/web/
Reading http://www.pythonweb.org/web/
Reading http://www.pythonweb.org/web/release/
No local packages or download links found for web
error: Could not find suitable distribution for Requirement.parse('web')
И я попробовал pip install web
но получаю следующее:
$ pip install web
Downloading/unpacking web
Could not find any downloads that satisfy the requirement web
No distributions at all found for web
Storing complete log in /Users/zcj90/.pip/pip.log
Traceback (most recent call last):
File "/usr/local/bin/pip", line 8, in <module>
load_entry_point('pip==1.0.2', 'console_scripts', 'pip')()
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/__init__.py", line 116, in main
return command.main(initial_args, args[1:], options)
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/basecommand.py", line 151, in main
log_fp = open_logfile(log_fn, 'w')
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/basecommand.py", line 180, in open_logfile
log_fp = open(filename, mode)
IOError: [Errno 13] Permission denied: '/Users/zcj90/.pip/pip.log'
Какие-либо предложения?
Код для app.py:
import web
urls = (
'/', 'index'
)
app = web.application(urls, globals())
class index:
def GET(self):
greeting = "Hello World"
return greeting
if __name__ == "__main__":
app.run()*