1
我想單步執行一個使用PyCharm CE在Gunicorn下運行的Hello-World燒瓶應用程序。使用PyCharm調試燒瓶應用程序下的燒瓶應用程序
該應用程序是通常的5-10班輪坐在/tmp/hello-world/app
和venv在/tmp/env
。
我PyCharm配置是這樣的:
Script: /tmp/env/bin/gunicorn
Script parameters: /tmp/hello-world/app:app
Working directory: /tmp/hello-world
該應用程序運行使用gunicorn app:app
在VENV命令行很好,但是當我啓動下PyCharm CE服務器,內部以gunicorn導入失敗:
Traceback (most recent call last):
File "/tmp/env/lib/python2.7/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
worker.init_process()
File "/tmp/env/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process
self.load_wsgi()
File "/tmp/env/lib/python2.7/site-packages/gunicorn/workers/base.py", line 135, in load_wsgi
self.wsgi = self.app.wsgi()
File "/tmp/env/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/tmp/env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/tmp/env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/tmp/env/lib/python2.7/site-packages/gunicorn/util.py", line 352, in import_app
__import__(module)
ImportError: Import by filename is not supported.
解決方案不起作用:
- 我沒有看到012關於macOS和PyCharm CE 2016.3的。這個答案在近四年後是否適用?