try:
import pkg_resources
__version__ = pkg_resources.require('modulename')[0].version
except:
__version__ = 'unknown'
//=== pkg_resources
http://stackoverflow.com/questions/7446187/no-module-named-pkg-resources
"""
pkg_resources appears to be distributed with setuptools
"""
setuptools --> ez_setup.py?
setuptools on pypi
https://pypi.python.org/pypi/setuptools
//=== No module named pkg_resources
http://ubuntuforums.org/showthread.php?t=2167383
$ cat /etc/lsb-release
$ curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | sudo python
$ sudo apt-get install --reinstall python-pkg-resources
$ sudo apt-get install python-pkg-resources python-setuptools --reinstall
[ref]
http://stackoverflow.com/questions/7446187/no-module-named-pkg-resources
http://kelfubuntu.blogspot.tw/2014/07/python27-ezsetup-pip-virtualenv.html
http://ubuntuforums.org/showthread.php?t=2167383
https://pythonhosted.org/setuptools/pkg_resources.html
No comments:
Post a Comment