I have developed a chat system by Python. libraries been used :easygui,pycrypto,netifaces,stepic,redis,rabbitmq,pika,PIL and setuptools.
all libraries seems installed well refer to : python> import library
by using redis-server on localhost, users can connect to redis and signup,login,chat,.. but when setting redis on different device and change localhost to redis server ip in codes, i receive following errors. (am using lubuntu last version in oracle virtual machine)
enter code here
Traceback (most recent call last):
File "kiducb.py", line 392, in <module>
g = Gui()
File "kiducb.py", line 19, in __init__
self.welcome()
File "kiducb.py", line 33, in welcome
rl = self.login()
File "kiducb.py", line 126, in login
resp = self.check_up(fvals[0], fvals[1], mac)
File "kiducb.py", line 76, in check_up
val = self.re.get(username)
File "/usr/lib/python2.7/dist-packages/redis/client.py", line 423, in get
return self.execute_command('GET', name)
File "/usr/lib/python2.7/dist-packages/redis/client.py", line 283, in execute_command
connection.send_command(*args)
File "/usr/lib/python2.7/dist-packages/redis/connection.py", line 260, in send_command
self.send_packed_command(self.pack_command(*args))
File "/usr/lib/python2.7/dist-packages/redis/connection.py", line 243, in
send_packed_command
self.connect()
File "/usr/lib/python2.7/dist-packages/redis/connection.py", line 191, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting 10.1.1.12:6379. Connection refused.
to solve this problem, i removed the redis-server which earlier i installed by useing apt-get from system, and i folowed this link instruction: https://www.digitalocean.com/community/articles/how-to-install-and-use-redis
Related
I followed the steps from the official documentation for ezsheets. Both apis were activated (sheets and drive) and I turned on a python shell and imported the ezsheets module. But, it did not open the new browser window like the documentation said it's supposed to. I then tried and successfully got google sheets working with googles' quickstart script. I have the credentials-sheets.json and token.pickle in the same folder as my python scripts. Sheets api seems to work just fine on it's own but when I try it with ezsheets module I get a following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/method/.local/share/virtualenvs/python_projects-sgt8dc05/lib/python3.6/site-packages/ezsheets/__init__.py", line 1559, in listSpreadsheets
if not IS_INITIALIZED: init()
File "/home/method/.local/share/virtualenvs/python_projects-sgt8dc05/lib/python3.6/site-packages/ezsheets/__init__.py", line 1520, in init
creds = flow.run_local_server()
File "/home/method/.local/share/virtualenvs/python_projects-sgt8dc05/lib/python3.6/site-packages/google_auth_oauthlib/flow.py", line 443, in run_local_server
host, port, wsgi_app, handler_class=_WSGIRequestHandler)
File "/usr/lib/python3.6/wsgiref/simple_server.py", line 153, in make_server
server = server_class((host, port), handler_class)
File "/usr/lib/python3.6/socketserver.py", line 456, in __init__
self.server_bind()
File "/usr/lib/python3.6/wsgiref/simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
File "/usr/lib/python3.6/http/server.py", line 136, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/lib/python3.6/socketserver.py", line 470, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
ezsheets is trying to open webserver on port 8000 to obtain access token. But it is already occupied by another app.
Chech what app listens on port 8000 and close it.
On Linux you can check it with
netstat -tulpn | grep 8000
On Windows:
netstat -ab
This image will help you to find the issue I have configured Openstack newton on ubunu 16.04 LTS. It works fine
Now i have planned to integrate Murano in to this.
All progressed fine..When i am running dashboard using "tox -e venv -- python manage.py runserver <IP:PORT>" command. I am able to run the murano dashboard.
When i am accessing environment tab it displaying error
Error: There was an error communicating with server.
And log message displays an error
No module named memcache
For your reference error message below:
Traceback (most recent call last):
File "/root/murano/murano/murano/api/middleware/fault.py", line 130, in
process_request
return req.get_response(self.application)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/request.py",
line 1299, in send
application, catch_exc_info=False)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/request.py",
line 1263, in call_application
app_iter = application(self.environ,
start_response)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/dec.py",
line 130, in __call__
resp = self.call_func(req, *args,
**self.kwargs)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/dec.py",
line 195, in call_func
return self.func(req, *args, **kwargs)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 320, in __call__
response = self.process_request(req)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 552, in process_request
resp = super(AuthProtocol,
self).process_request(request)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 348, in process_request
data, user_auth_ref =
self._do_fetch_token(request.user_token)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 388, in _do_fetch_token
data = self.fetch_token(token)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 661, in fetch_token
cached =
self._cache_get_hashes(token_hashes)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 644, in _cache_get_hashes
cached =
self._token_cache.get(token)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/_cache.py",
line 214, in get
with self._cache_pool.reserve() as cache:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/_cache.py",
line 78, in reserve
import memcache
ImportError: No module named memcache
Can someone help on this?
Thanks in Advance.
Just installing memcached is not enough. You will also need to install python memcache module which is provided separately by python-memcache and python-pymemcache. I am not sure which one is used here.
You can try installing them with apt-get and see which one works for you.
Now working.. I have installed murano api and murano dashboard in different venv.
I have missed to install memcache in munano api venv. When i'm tried after install memcache in murano api venv..Now working fine..
#tutuDajuju Thanks for the Help...
I have this error when I run my code in server, my env is debian, and Python2.7.3
Traceback (most recent call last):
File "fetcher.py", line 4, in <module>
import mirad.fetcher_tasks as tasks
File "/home/mirad/backend/mirad/fetcher_tasks.py", line 75, in <module>
redis_keys = r.keys('*')
File "/home/mirad/backend/venv/local/lib/python2.7/site-packages/redis/client.py", line 863, in keys
return self.execute_command('KEYS', pattern)
File "/home/mirad/backend/venv/local/lib/python2.7/site-packages/redis/client.py", line 534, in execute_command
connection.send_command(*args)
File "/home/mirad/backend/venv/local/lib/python2.7/site-packages/redis/connection.py", line 532, in send_command
self.send_packed_command(self.pack_command(*args))
File "/home/mirad/backend/venv/local/lib/python2.7/site-packages/redis/connection.py", line 508, in send_packed_command
self.connect()
File "/home/mirad/backend/venv/local/lib/python2.7/site-packages/redis/connection.py", line 412, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error -2 connecting to localhost:6379. Name or service not known.
when I run redis-cli it works correctly without any error:
$ redis-cli
127.0.0.1:6379>
It seems that you are trying connect redis with server that is unidentified by your current Debian environment.
From Traceback, I see you are trying to connect using host name as localhost ,
r_server=redis.Redis(host="localhost",port=6379)
But , your system is unable to understand "localhost" , make entry in hosts file i.e saying 127.0.0.1 is localhost. add below code in /etc/hosts
127.0.0.1 localhost
otherwise connect redis using below command ;
r_server=redis.Redis(host="127.0.0.1",port=6379)
I faced a similar problem and later on realized that I have not opened redis in the terminal by command: $ redis-server.
Maybe it is the case.
Need some help starting up the djangoappengine testapp.I followed the instructions at http://www.allbuttonspressed.com/projects/djangoappengine, but when I run ./manage.py runserver . while in the project directory I get the following error:
WARNING 2011-03-24 12:23:21,994 datastore_file_stub.py:657] Could not read datastore
data from /media/disk/Projex/AppEngineApp/app/.gaedata/datastore
Error: option --rdbms_sqlite_path not recognized
Runs a development application server for an application.
manage.py [options] <application root>__
When I try and comment the ' 'rdbms_sqlite_path': os.path.join(DATA_ROOT, 'rdbms'),' line in app/djangoappengine/db/base.py I get the following error:
WARNING 2011-03-24 12:26:07,239 datastore_file_stub.py:657] Could not read datastore
data from /media/disk/Projex/AppEngineApp/app/.gaedata/datastore
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_manager(settings)
File "/media/disk/Projex/AppEngineApp/app/django/core/management/__init__.py", line 438,
in execute_manager
utility.execute()
File "/media/disk/Projex/AppEngineApp/app/django/core/management/__init__.py", line 379,
in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/media/disk/Projex/AppEngineApp/app/djangoappengine/management/commands/runserver.py",
line 94, in run_from_argv
start_dev_appserver(argv)
File
"/media/disk/Projex/AppEngineApp/app/djangoappengine/management/commands/runserver.py",
line 81, in start_dev_appserver
dev_appserver_main.main([progname] + args + [PROJECT_DIR])
File "/usr/local/gaepy/google/appengine/tools/dev_appserver_main.py", line 426, in main
static_caching=static_caching)
File "/usr/local/gaepy/google/appengine/tools/dev_appserver.py", line 3820, in
CreateServer
server = HTTPServerWithScheduler((serve_address, port), handler_class)
File "/usr/local/gaepy/google/appengine/tools/dev_appserver.py", line 3840, in __init__
request_handler_class)
File "/usr/lib/python2.6/SocketServer.py", line 400, in __init__
self.server_bind()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 108, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/lib/python2.6/SocketServer.py", line 411, in server_bind
self.socket.bind(self.server_address)
File "<string>", line 1, in bind
socket.gaierror: [Errno -5] No address associated with hostname
Anyone experienced this issue ?
You probably already solved this, but for future users:
The warning can have multiple causes:
data store is empty, in that case ignore
wrong permissions on the datastore files
data corruption issue
The error can be solved by updating djangoappengine
Update to the latest version of google app engine.
I am trying to use the google appengine python SKD from my ubuntu lucid. I have already compiled python2.5. But when I execute any "dev_appserver.py" command with it I get the following error:
Traceback (most recent call last):
File "dev_appserver.py", line 69, in <module>
run_file(__file__, globals())
File "dev_appserver.py", line 65, in run_file
execfile(script_path, globals_)
File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver_main.py", line 90, in <module>
from google.appengine.tools import appcfg
File "/media/Ultimate/WebD/django/app_engine/google_appengine/google/appengine/tools/appcfg.py", line 59, in <module>
from google.appengine.tools import appengine_rpc
File "/media/Ultimate/WebD/django/app_engine/google_appengine/google/appengine/tools/appengine_rpc.py", line 24, in <module>
import fancy_urllib
File "/media/Ultimate/WebD/django/app_engine/google_appengine/lib/fancy_urllib/fancy_urllib/__init__.py", line 328, in <module>
class FancyHTTPSHandler(urllib2.HTTPSHandler):
AttributeError: 'module' object has no attribute 'HTTPSHandler'
I have checked the urllib2 moduls of python2.6 and python2.5 but there was no difference in the models defination and HTTPSHandelr is there in python2.5 too. So I guess it is some other sort of error.
I tried to run with the default python2.6 too but then I get the following error:
WARNING 2010-09-11 12:08:40,848 datastore_file_stub.py:657] Could not read datastore data from /tmp/dev_appserver.datastore
Traceback (most recent call last):
File "./dev_appserver.py", line 69, in <module>
run_file(__file__, globals())
File "./dev_appserver.py", line 65, in run_file
execfile(script_path, globals_)
File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver_main.py", line 449, in <module>
sys.exit(main(sys.argv))
File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver_main.py", line 426, in main
static_caching=static_caching)
File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver.py", line 3820, in CreateServer
server = HTTPServerWithScheduler((serve_address, port), handler_class)
File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver.py", line 3840, in __init__
request_handler_class)
File "/usr/lib/python2.6/SocketServer.py", line 400, in __init__
self.server_bind()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 108, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/lib/python2.6/SocketServer.py", line 411, in server_bind
self.socket.bind(self.server_address)
File "<string>", line 1, in bind
socket.error: [Errno 98] Address already in use
It works well in windows and even under wine.
Update
Problem with python2.6 solved.
I had configured my apache server for a django deployment on the 8080 and 80 port some time earlier.
But there is still same error with python2.5 isntallation.
Solved the issue...just needed to build all dependencies of python using:
apt-get build-dep python
python compiles with no error even when all the dependencies are not installed. It just skips the modules which require them and builds python.
Solution for missing HTTPSHandler:
Before you build python 2.5 from source you need to enable ssl-socket by editing Modules/Setup.dist (more info here http://paltman.com/2007/nov/15/getting-ssl-support-in-python-251/)
The method described in this post worked perfectly for me (Ubuntu 11.10).
http://dewbot.posterous.com/installation-of-python-25-and-google-app-engi