2015-08-28 55 views
0

這裏是我做的步驟:剛纔添加這一行Django和authomatic:導入錯誤:無法導入名 '六個'

  • CD [mydjangoproject]
  • git clone git://github.com/peterhudec/authomatic.git
  • 進入我的看法,:from authomatic import authomatic

我djangoproject樹是這個樣子:

├── authomatic 
│   ├── assets 
│   ├── authomatic 
│   ├── doc 
│   ├── examples 
│   ├── javascript 
│   └── tests 
├── locale 
│   ├── en 
│   ├── fr 
│   └── sv 
├── produits 
│   ├── migrations 
│   └── templatetags 
├── pyweb 
├── static 
│   ├── css 
│   ├── fonts 
│   ├── images 
│   ├── js 
│   └── produits 
└── templates 
   └── produits 

的問題出現在[mydjangoproject]/authomatic/authomatic/__init__.py,21行,它是這樣的代碼:

from . import six 

當然我再次檢查該文件是否存在:

>cd [mydjangoproject]/authomatic/authomatic/ 
>find . 
. 
./adapters.py 
./core.py 
./exceptions.py 
...blabla... 
./six.py 
./__init__.py 

什麼奇怪的是與Pycharm,如果我在文件上__init__.py在句子from . import sixsix按住Ctrl鍵單擊,Pycharm發現它並顯示six.py文件...

它應該工作我猜...任何想法發生了什麼?

+0

不會是,從自動導入六'? – Lonoshea

回答

0

這是一個有點哈克,但我已經在settings.py文件手動添加所有的路徑是這樣的:

sys.path.append('./third_party/defusedxml-0.4.1') 
sys.path.append('./third_party/python3-openid') 
sys.path.append('./third_party/authomatic_0_1_0') 

它似乎工作。現在我面臨的事實是,谷歌應用程序引擎不支持Python 3,這對於一家聲稱體現「最先進技術」的公司來說是不明白的。

相關問題