2013-07-22 32 views
0

那里!如何为Django安装phonenumbers

我想在我的Ubuntu上运行一个导入的应用程序。但屏幕上显示的错误消息指出No module named phonenumbers

所以我试图安装它,方法是:

sudo easy_install phonenumbers 

但同样,它会抛出错误,并说ImportError: No module named shortdata

然后我试图运行

sudo easy_install shortdata 

这一次,它给了我:

error: Could not find suitable distribution for Requirement.parse('shortdata') 

我想不出如何安装'shortdata'。

我能做些什么来安装'phonenumbers'?

回答

0

发生此问题的原因是模块'shortdata'在安装时丢失。您可以通过从源代码安装并手动复制模块的“shortdata”来纠正问题。

1)Download source from https://github.com/daviddrysdale/python-phonenumbers 
2)Install phonenumbers using setup.py (python setup.py install) 
3)Manually copy folder 'shortdata' from python-phonenumbers-dev/python/phonenumbers in source to your installed location(python2.7/site-packages/phonenumbers-5.7b1-py2.7.egg/phonenumbers)