2017-05-08 61 views
1

我試圖在Predix上推送一個Python Microservice。
該代碼具有matplotlib依賴關係。Predix:沒有名爲_tkinter的模塊

cf push對於具有以下堆棧跟蹤的應用程序失敗。

2017-05-08T19:39:51.43+0530 [App/0]  ERR Traceback (most recent call last): 
2017-05-08T19:39:51.43+0530 [App/0]  ERR File "server.py", line 7, in <module> 
2017-05-08T19:39:51.43+0530 [App/0]  ERR  from services.testService import TestServiceOptimalFrequencyForward as TestService 
2017-05-08T19:39:51.43+0530 [App/0]  ERR File "/home/vcap/app/services/testService.py", line 12, in <module> 
2017-05-08T19:39:51.43+0530 [App/0]  ERR  from models import test 
2017-05-08T19:39:51.43+0530 [App/0]  ERR File "/home/vcap/app/models/test.py", line 5, in <module> 
2017-05-08T19:39:51.43+0530 [App/0]  ERR  from models import model1, model2, model3, pvt 
2017-05-08T19:39:51.43+0530 [App/0]  ERR File "/home/vcap/app/models/model2.py", line 23, in <module> 
2017-05-08T19:39:51.43+0530 [App/0]  ERR  import matplotlib.pyplot as plt 
2017-05-08T19:39:51.43+0530 [App/0]  ERR File "/app/.heroku/python/lib/python2.7/site-packages/matplotlib/pyplot.py", line 115, in <module> 
2017-05-08T19:39:51.43+0530 [App/0]  ERR File "/app/.heroku/python/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup 
2017-05-08T19:39:51.43+0530 [App/0]  ERR  globals(),locals(),[backend_name],0) 
2017-05-08T19:39:51.43+0530 [App/0]  ERR File "/app/.heroku/python/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module> 
2017-05-08T19:39:51.43+0530 [App/0]  ERR  _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() 
2017-05-08T19:39:51.43+0530 [App/0]  ERR  from six.moves import tkinter as Tk 
2017-05-08T19:39:51.43+0530 [App/0]  ERR File "/app/.heroku/python/lib/python2.7/site-packages/six.py", line 203, in load_module 
2017-05-08T19:39:51.43+0530 [App/0]  ERR  mod = mod._resolve() 
2017-05-08T19:39:51.43+0530 [App/0]  ERR File "/app/.heroku/python/lib/python2.7/site-packages/six.py", line 115, in _resolve 
2017-05-08T19:39:51.43+0530 [App/0]  ERR  return _import_module(self.mod) 
2017-05-08T19:39:51.43+0530 [App/0]  ERR File "/app/.heroku/python/lib/python2.7/site-packages/six.py", line 82, in _import_module 
2017-05-08T19:39:51.43+0530 [App/0]  ERR  __import__(name) 
2017-05-08T19:39:51.43+0530 [App/0]  ERR File "/app/.heroku/python/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module> 
2017-05-08T19:39:51.43+0530 [App/0]  ERR  import _tkinter # If this fails your Python may not be configured for Tk 
2017-05-08T19:39:51.43+0530 [App/0]  ERR ImportError: No module named _tkinter 
2017-05-08T19:39:51.53+0530 [App/0]  OUT 
2017-05-08T19:39:51.57+0530 [DEA/55]  ERR Instance (index 0) failed to start accepting connections 

我正在使用python_buildpack

在此先感謝,爲解決此問題的任何幫助。

回答

0

假如你運行的是Linux做 sudo易於得到安裝python-tk的

也許你有事後重新編譯了Python。

+1

由於cloud Foundry不允許我們進行任何安裝,所以建議的方式是不可能的。 –