2013-05-12 91 views
0
在virutalenv項目中使用

蟒蛇的virtualenv模塊未匯入

pip install markdown 

我已經安裝了降價,運行PIP凍結顯示我的安裝。

但嘗試使用它

import markdown 
ImportError: No module named markdown 

的應用程序使用谷歌應用程序引擎時,我得到了下面的錯誤。添加它來作爲app.yml

libraries: 
- name: webapp2 
    version: latest 
- name: jinja2 
    version: latest 

給我

raise yaml_errors.EventError(e, event_object) 
google.appengine.api.yaml_errors.EventError: the library "markdown" is not supported 

回答

0

可以導入任意庫中的AppEngine,但不是通過libraries指令app.yaml中。

此外,你不能下的AppEngine運行的virtualenv。

可以使用的virtualenv/PIP/easy_install的安裝庫和他們的依賴關係,但你需要鏈接/庫複製到你的項目和操縱你的sys.path適當。

+0

我下的virtualenv運行AppEngine上,我所做的就是符號鏈接的SDK在我的virtualenv文件夾 - 我已經有AppEngine上系統範圍內安裝 – 2013-05-12 08:35:04

+0

不這樣做的最酷的方式,但它的工作:) – 2013-05-12 08:41:14

+0

你設置的virtualenv與 - 無站點包?這通常是你會做什麼,所以不污染環境的其餘部分。 – 2013-05-12 13:31:12

0

您不能導入任意第三方庫到GAE​​應用程序。支持圖書館的正式名單爲here,它不包括降價。