本文主要是介绍Problems Solutions -- 9 No Socket could be created,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
这几天重新学习 Learn Python The Hard Way , 花了5~6 天时间,前前后后又学了一遍,收获很多。
遇到了这个错误:
(learn_web) for-python@ubuntu:~/mystuff/projects/gothonweb$ python2 bin/app.py
http://0.0.0.0:8080/
Traceback (most recent call last):File "bin/app.py", line 15, in <module>app.run()File "/home/for-python/.local/lib/python2.7/site-packages/web/application.py", line 310, in runreturn wsgi.runwsgi(self.wsgifunc(*middleware))File "/home/for-python/.local/lib/python2.7/site-packages/web/wsgi.py", line 54, in runwsgireturn httpserver.runsimple(func, validip(listget(sys.argv, 1, '')))File "/home/for-python/.local/lib/python2.7/site-packages/web/httpserver.py", line 148, in runsimpleserver.start()File "/home/for-python/.local/lib/python2.7/site-packages/web/wsgiserver/__init__.py", line 1753, in startraise socket.error(msg)
socket.error: No socket could be created
真的,主要还是这些名词不熟悉,端口被占用了。
重换一个端口,python2 bin/app.py 8001
就好了:
(虚拟环境中默认使用python3,这里指定使用python2)
(learn_web) for-python@ubuntu:~/mystuff/projects/gothonweb$ python2 bin/app.py 8001
http://0.0.0.0:8001/
这篇关于Problems Solutions -- 9 No Socket could be created的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!