Pylons Google App Engine installation raise an error - python

I used latest version of GAE.
I try install Pylons v1.0 with this help article:
http://countergram.com/pylons-google-app-engine
paster serve --reload development.ini
work fine
Apache2+wsgi work fine
But: dev_appserver.py pylons
I have got error message:
INFO:root:Starting admin server at: [Link to localhost:8000 ERROR]
2013-07-11 11:55:07,816 cgi.py:121] Traceback (most recent call last):
File "/home/evgeny/PycharmProjects/pylons/app.py", line 41, in
run_wsgi_app(loadapp('config:development.ini',
relative_to=appdir)) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in
loadapp ret*emphasized text*urn loadobj(APP, uri, name=name, **kw) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 271, in
loadobj global_conf=global_conf) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 296, in
loadcontext global_conf=global_conf) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 320, in
_loadconfig return loader.get_context(object_type, name, global_conf) File "lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 454,
in get_context section) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 476, in
_context_from_use object_type, name=use, global_conf=global_conf) File "lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 406,
in get_context global_conf=global_conf) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 296, in
loadcontext global_conf=global_conf) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 328, in
_loadegg return loader.get_context(object_type, name, global_conf) File "lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 620,
in get_context object_type, name=name) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 646, in
find_egg_entry_point possible.append((entry.load(), protocol,
entry.name)) File
"lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py",
line 1991, in load entry = import(self.module_name,
globals(),globals(), ['name']) File
"project/project/config/middleware.py", line 9, in from
routes.middleware import RoutesMiddleware File
"lib/python2.7/site-packages/routes/init.py", line 140, in
from routes.mapper import Mapper File
"lib/python2.7/site-packages/routes/mapper.py", line 7, in
from repoze.lru import LRUCache ImportError: No module named
repoze.lru

It's really simple decision.
At virtualenv path:
touch lib/python2.7/site-packages/repoze/__init__.py

Related

Error while upgrading superset to 2.0.0 psycopg2.errors.UndefinedColumn

After updating superset to 2.0.0 I cannot access sqllab nor view databases (Oracle DB).
I'm running superset on openshift with custom image built from apache/superset:2.0.0
Installed dependencies:
cx_Oracle certifi flask-oidc==1.4.0 flask_openid gevent psycopg2 psycopg2-binary==2.9.1 redis==3.5.3 itsdangerous==2.0.1
I tried running superset db upgrade with following result:
$ superset db upgrade
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
logging was configured successfully
2022-11-21 14:21:41,835:INFO:superset.utils.logging_configurator:logging was configured successfully
2022-11-21 14:21:41,841:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
and superset init throws error:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.UndefinedColumn: column dbs.allow_multi_schema_metadata_fetch does not exist
LINE 1: ..., dbs.force_ctas_schema AS dbs_force_ctas_schema, dbs.allow_...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/superset", line 33, in \<module\>
sys.exit(load_entry_point('apache-superset', 'console_scripts', 'superset')())
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
return self.main(\*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 601, in main
return super().main(\*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
return \_process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, \*\*ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return \__callback(\*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), \*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 445, in decorator
return \__ctx.invoke(f, \*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return \__callback(\*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), \*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 445, in decorator
return \__ctx.invoke(f, \*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return _callback(\*args, \*\*kwargs)
File "/app/superset/cli/main.py", line 62, in init
security_manager.sync_role_definitions()
File "/app/superset/security/manager.py", line 731, in sync_role_definitions
self.create_missing_perms()
File "/app/superset/security/manager.py", line 679, in create_missing_perms
merge_pv("datasource_access", datasource.get_perm())
File "/app/superset/connectors/sqla/models.py", line 826, in get_perm
if self.database is None:
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 294, in __get__
return self.impl.get(instance_state(instance), dict_)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 730, in get
value = self.callable(state, passive)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/strategies.py", line 759, in \_load_for_state
return self.\_emit_lazyload(
File "\<string\>", line 1, in \<lambda\>
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/strategies.py", line 847, in \_emit_lazyload
q(session)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/ext/baked.py", line 615, in \_load_on_pk_identity
result = list(bq.for_session(self.session).params(\*\*params))
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/ext/baked.py", line 444, in __iter__
return q.\_execute_and_instances(context)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3560, in \_execute_and_instances
result = conn.execute(querycontext.statement, self.\_params)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in \_execute_on_connection
return connection.\_execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in \_execute_clauseelement
ret = self.\_execute_context(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in \_execute_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in handle_dbapi_exception
util.raise_(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise
raise exception
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column dbs.allow_multi_schema_metadata_fetch does not exist
LINE 1: ..., dbs.force_ctas_schema AS dbs_force_ctas_schema, dbs.allow_...
^
\[SQL: SELECT dbs.uuid AS dbs_uuid, dbs.created_on AS dbs_created_on, dbs.changed_on AS dbs_changed_on, dbs.id AS dbs_id, dbs.verbose_name AS dbs_verbose_name, dbs.database_name AS dbs_database_name, dbs.sqlalchemy_uri AS dbs_sqlalchemy_uri, dbs.password AS dbs_password, dbs.cache_timeout AS dbs_cache_timeout, dbs.select_as_create_table_as AS dbs_select_as_create_table_as, dbs.expose_in_sqllab AS dbs_expose_in_sqllab, dbs.configuration_method AS dbs_configuration_method, dbs.allow_run_async AS dbs_allow_run_async, dbs.allow_file_upload AS dbs_allow_file_upload, dbs.allow_ctas AS dbs_allow_ctas, dbs.allow_cvas AS dbs_allow_cvas, dbs.allow_dml AS dbs_allow_dml, dbs.force_ctas_schema AS dbs_force_ctas_schema, dbs.allow_multi_schema_metadata_fetch AS dbs_allow_multi_schema_metadata_fetch, dbs.extra AS dbs_extra, dbs.encrypted_extra AS dbs_encrypted_extra, dbs.impersonate_user AS dbs_impersonate_user, dbs.server_cert AS dbs_server_cert, dbs.is_managed_externally AS dbs_is_managed_externally, dbs.external_url AS dbs_external_url, dbs.created_by_fk AS dbs_created_by_fk, dbs.changed_by_fk AS dbs_changed_by_fk
FROM dbs
WHERE dbs.id = %(param_1)s\]
\[parameters: {'param_1': 1}\]
(Background on this error at: http://sqlalche.me/e/13/f405)
Anyone found solution for this error?
Tried:
superset db upgrade
superset init
updating dependencies
restarting superset
Expect:
successfully migrate to 2.0.0 version

When i run 'pip install scipy' on my Pycharm Terminal i get Attribute Error

i am trying to install scipy package on one of my Pycharm projects. i get the following Attribute Error,
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'text_temp'
following is the exception that i am getting,
Collecting scipy
Exception:
Traceback (most recent call last):
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/cli/base_command.py", line 179, in main
status = self.run(options, args)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/commands/install.py", line 315, in run
resolver.resolve(requirement_set)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/resolve.py", line 131, in resolve
self._resolve_one(requirement_set, req)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/resolve.py", line 294, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/resolve.py", line 242, in _get_abstract_dist_for
self.require_hashes
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/operations/prepare.py", line 269, in prepare_linked_requirement
req.populate_link(finder, upgrade_allowed, require_hashes)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/req/req_install.py", line 196, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/index.py", line 639, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/index.py", line 614, in find_all_candidates
self._package_versions(page.iter_links(), search)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/index.py", line 775, in _package_versions
for link in self._sort_links(links):
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/index.py", line 759, in _sort_links
for link in links:
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_internal/index.py", line 971, in iter_links
namespaceHTMLElements=False,
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_vendor/html5lib/html5parser.py", line 47, in parse
return p.parse(doc, **kwargs)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_vendor/html5lib/html5parser.py", line 289, in parse
self._parse(stream, False, None, *args, **kwargs)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_vendor/html5lib/html5parser.py", line 134, in _parse
self.mainLoop()
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_vendor/html5lib/html5parser.py", line 239, in mainLoop
new_token = phase.processSpaceCharacters(new_token)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_vendor/html5lib/html5parser.py", line 469, in processSpaceCharacters
self.tree.insertText(token["data"])
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_vendor/html5lib/treebuilders/base.py", line 357, in insertText
parent.insertText(data)
File "/Users/rohitgite/PycharmProjects/HelloWorld/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_vendor/html5lib/treebuilders/etree.py", line 109, in insertText
if not self._element.text_temp:
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'text_temp'

Django Server Just Stops

I just got done upgrading to Django 2.2.3 from version 2.0.
For some reason the system will just stop working when going to a new page. I might go one or to pages and then the server stops.
I am also using Cookiecutter.
Below is a typical message that I am receiving. Though it changes.
it was acting strange before this - why I upgraded.
I checked all my migrations. Reinstalled Django. Using Pycharm.
Thanks.
[17/Jul/2019 08:26:04] "GET /account/login/ HTTP/1.1" 200 13126
[17/Jul/2019 08:26:04] "GET /static/CACHE/css/app.8e450f098f62.css HTTP/1.1" 200 323872
AttributeError: cffi library '_ffi' has no function, constant or global variable named '__spec__'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/benson/PycharmProjects/myanalysis/manage.py", line 29, in <module>
execute_from_command_line(sys.argv)
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 60, in execute
super().execute(*args, **options)
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 95, in handle
self.run(**options)
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 579, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 564, in start_django
reloader.run(django_main_thread)
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 275, in run
self.run_loop()
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 281, in run_loop
next(ticker)
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 321, in tick
state.update(self.loop_files(state, previous_timestamp))
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 328, in loop_files
for path, mtime in self.snapshot_files():
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 348, in snapshot_files
for file in self.watched_files():
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 241, in watched_files
yield from iter_all_python_module_files()
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "/Users/benson/PycharmProjects/myanalysis/v_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 114, in iter_modules_and_files
if not isinstance(module, ModuleType) or getattr(module, '__spec__', None) is None:
SystemError: <built-in function getattr> returned a result with an error set

socket.gaierror when trying to run emr using python mrjob

I currently trying to learn mrjob and how to implement it in AWS EMR so please forgive me if I am asking already asked question [searched many places but did not find the answer] and sorry if it is a silly question
This is my python script :
from mrjob.job import MRJob
class MRWordFrequencyCount(MRJob):
def mapper(self, _, line):
yield "chars", len(line)
yield "words", len(line.split())
yield "lines", 1
def reducer(self, key, values):
yield key, sum(values)
if __name__ == '__main__':
MRWordFrequencyCount.run()
When I run it in local mode I got the result
cmd:
python sample.py input.txt
So I tried to run this in EMR
by creating a mrjob.conf file
which looks like this :
runners:
emr:
aws_access_key_id:
aws_secret_access_key:
aws_region: us-west-2a
ec2_key_pair: emr
ec2_key_pair_file: ~/Desktop/emr.pem
ec2_instance_type: m1.small
num_ec2_instances: 5
local:
base_tmp_dir: /tmp
First attempt
Trying it locally on my windows system
python check.py -r emr --conf-path ./mrjob.conf word.txt
Note :
Same error came when I kept the input in s3 location and gave it as an argument
I got this traceback:
Traceback (most recent call last):
File "check.py", line 16, in <module>
MRWordFrequencyCount.run()
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\mrjob\job.py", line 461, in run
mr_job.execute()
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\mrjob\job.py", line 479, in execute
super(MRJob, self).execute()
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\mrjob\launch.py", line 153, in execute
self.run_job()
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\mrjob\launch.py", line 215, in run_job
with self.make_runner() as runner:
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\mrjob\job.py", line 502, in make_runner
return super(MRJob, self).make_runner()
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\mrjob\launch.py", line 168, in make_runner
return EMRJobRunner(**self.emr_job_runner_kwargs())
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\mrjob\emr.py", line 643, in __init__
self._fix_s3_scratch_and_log_uri_opts()
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\mrjob\emr.py", line 760, in _fix_s3_scratch_and_log_uri_opts
self._set_s3_scratch_uri(s3_conn)
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\mrjob\emr.py", line 776, in _set_s3_scratch_uri
buckets = s3_conn.get_all_buckets()
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\mrjob\retry.py", line 149, in call_and_maybe_retry
return f(*args, **kwargs)
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\boto\s3\connection.py", line 436, in get_all_buckets
response = self.make_request('GET', headers=headers)
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\boto\s3\connection.py", line 664, in make_request
retry_handler=retry_handler
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\boto\connection.py", line 1070, in make_request
retry_handler=retry_handler)
File "C:\Users\MOB140003207\AppData\Local\Enthought\Canopy32\User\lib\site-pac
kages\boto\connection.py", line 1029, in _mexe
raise ex
socket.gaierror: [Errno 11004] getaddrinfo failed
When I tried to run it in aws EC2 instance
I got this error
Traceback (most recent call last):
File "check.py", line 16, in <module>
MRWordFrequencyCount.run()
File "/usr/local/lib/python2.7/dist-packages/mrjob/job.py", line 461, in run
mr_job.execute()
File "/usr/local/lib/python2.7/dist-packages/mrjob/job.py", line 479, in execute
super(MRJob, self).execute()
File "/usr/local/lib/python2.7/dist-packages/mrjob/launch.py", line 153, in execute
self.run_job()
File "/usr/local/lib/python2.7/dist-packages/mrjob/launch.py", line 215, in run_job
with self.make_runner() as runner:
File "/usr/local/lib/python2.7/dist-packages/mrjob/job.py", line 502, in make_runner
return super(MRJob, self).make_runner()
File "/usr/local/lib/python2.7/dist-packages/mrjob/launch.py", line 168, in make_runner
return EMRJobRunner(**self.emr_job_runner_kwargs())
File "/usr/local/lib/python2.7/dist-packages/mrjob/emr.py", line 643, in __init__
self._fix_s3_scratch_and_log_uri_opts()
File "/usr/local/lib/python2.7/dist-packages/mrjob/emr.py", line 760, in _fix_s3_scratch_and_log_uri_opts
self._set_s3_scratch_uri(s3_conn)
File "/usr/local/lib/python2.7/dist-packages/mrjob/emr.py", line 776, in _set_s3_scratch_uri
buckets = s3_conn.get_all_buckets()
File "/usr/local/lib/python2.7/dist-packages/mrjob/retry.py", line 149, in call_and_maybe_retry
return f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 436, in get_all_buckets
response = self.make_request('GET', headers=headers)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 664, in make_request
retry_handler=retry_handler
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1071, in make_request
retry_handler=retry_handler)
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1030, in _mexe
raise ex
socket.gaierror: [Errno -2] Name or service not known
I don't know what I am doing wrong
python version 2.7 mrjob version '0.4.5'
After hours of searching and investigating I found the problem
It was in this line
aws_region: us-west-2a
Where as it should have been
aws_region: us-west-2
I just want to keep the question alive since it may save other people time

Error in paster setup-app development.ini?

I am trying to install MediaCore on my machine running CentOS as soon as I fire this coomand
on command prompt it gives me an error
[root#localhost mediacore-mediacore-e6e7419]# paster setup-app development.ini Traceback (most recent call last):
File "/usr/bin/paster", line 7, in ?
sys.exit( File "/usr/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/command.py", line 84, in run invoke(command, command_name, options, args[1:])
File "/usr/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/command.py", line 123, in invoke exit_code = runner.run(args)
File "/usr/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/appinstall.py", line 68, in run return super(AbstractInstallCommand, self).run(new_args)
File "/usr/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/command.py", line 218, in run result = self.command()
File "/usr/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/appinstall.py", line 447, in command conf = appconfig(config_spec, relative_to=os.getcwd()) File "/usr/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", line 215, in appconfig global_conf=global_conf)
File "/usr/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", line 248, in loadcontext global_conf=global_conf)
File "/usr/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", line 278, in _loadconfig return loader.get_context(object_type, name, global_conf) File "/usr/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", line 409, in get_context section)
File "/usr/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", line 430, in _context_from_use context = self.get_context(
File "/usr/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", line 361, in get_context global_conf=global_conf)
File "/usr/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", line 248, in loadcontext global_conf=global_conf)
File "/usr/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", line 285, in _loadegg return loader.get_context(object_type, name, global_conf) File "/usr/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", line 560, in get_context entry_point, protocol, ep_name = self.find_egg_entry_point( File "/usr/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", line 587, in find_egg_entry_point
possible.append((entry.load(), protocol, entry.name))
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/root/medi/mediacore-mediacore-e6e7419/mediacore/config/middleware.py", line 19, in ? from beaker.middleware import SessionMiddleware
File "/usr/lib/python2.4/site-packages/Beaker-1.6.1-py2.4.egg/beaker/middleware.py", line 11, in ? from beaker.cache import CacheManager
File "/usr/lib/python2.4/site-packages/Beaker-1.6.1-py2.4.egg/beaker/cache.py", line 17, in ? import beaker.ext.memcached as memcached
File "/usr/lib/python2.4/site-packages/Beaker-1.6.1-py2.4.egg/beaker/ext/memcached.py", line 136 with self.pool.reserve() as mc:
^
SyntaxError: invalid syntax
Any Help will be greatly appreciated.
Thanks
The with statement only appeared in python2.5, and you're using python2.4. It looks that Beaker is not really compatible with python2.4.

Categories

Resources