我是Python的新手,我需要运行我的rails项目,它依赖于Python应用程序。我在Mysql中使用Python并尝试运行服务器,但它引发了一个错误:
17:41:41 affiliates.1 | /home/jayashri/homebrew/izea-exchange-master/affiliates/plugins/antipool.py:477: UserWarning: Warning: Your DBAPI module '<module 'MySQLdb' from '/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.4b4-py2.7-linux-x86_64.egg/MySQLdb/__init__.pyc'>' does not support sharing connections between threads.
17:41:41 affiliates.1 | "connections between threads." % str(dbapi))
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Listening for SIGHUP.
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Listening for SIGTERM.
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Listening for SIGUSR1.
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Bus STARTING
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE PID 22407 written to './affiliates_dev.pid'.
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Started monitor thread '_TimeoutMonitor'.
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Started monitor thread 'Autoreloader'.
17:41:42 lucre.1 | => Booting WEBrick
17:41:42 lucre.1 | => Rails 2.3.15 application starting
17:41:46 affiliates.1 | [15/Jan/2014:17:41:46] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0x1470f50>>
17:41:46 affiliates.1 | Traceback (most recent call last):
17:41:46 affiliates.1 | File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/process/wspbus.py", line 147, in publish
17:41:46 affiliates.1 | output.append(listener(*args, **kwargs))
17:41:46 affiliates.1 | File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/_cpserver.py", line 90, in start
17:41:46 affiliates.1 | ServerAdapter.start(self)
17:41:46 affiliates.1 | File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/process/servers.py", line 53, in start
17:41:46 affiliates.1 | wait_for_free_port(*self.bind_addr)
17:41:46 affiliates.1 | File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/process/servers.py", line 251, in wait_for_free_port
17:41:46 affiliates.1 | raise IOError("Port %r not free on %r" % (port, host))
17:41:46 affiliates.1 | IOError: Port 7180 not free on '0.0.0.0'
17:41:46 affiliates.1 |
17:41:46 affiliates.1 | [15/Jan/2014:17:41:46] ENGINE Shutting down due to error in start listener:
17:41:46 affiliates.1 | Traceback (most recent call last):
17:41:46 affiliates.1 | File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/process/wspbus.py", line 184, in start发布于 2014-01-15 14:16:25
twil是对的--每个python应用程序都需要一个不同的端口。如果您作为root用户在linux上运行此命令(它将告诉您其他python应用程序正在运行)
ps -ef | grep python找到这些应用程序正在运行的端口,然后选择另一个端口。您可以使用该端口使用其他非python应用程序。如果那样的话你应该看看是什么用的端口..。
希望这能有所帮助!
https://stackoverflow.com/questions/21137230
复制相似问题