python - Exception while importing pymorphy2 -
i've installed pymorphy2 using pip:
requirement satisfied (use --upgrade upgrade): pymorphy2 in /usr/local/lib/python2.7/site-packages requirement satisfied (use --upgrade upgrade): docopt>=0.6 in /usr/local/lib/python2.7/site-packages (from pymorphy2) requirement satisfied (use --upgrade upgrade): pymorphy2-dicts<3.0,>=2.4 in /usr/local/lib/python2.7/site-packages (from pymorphy2)
but when i'm trying import library in python interactive shell this:
>>> import pymorphy2 traceback (most recent call last): file "<stdin>", line 1, in <module> file "/usr/local/lib/python2.7/site-packages/pymorphy2/__init__.py", line 3, in <module> .analyzer import morphanalyzer file "/usr/local/lib/python2.7/site-packages/pymorphy2/analyzer.py", line 10, in <module> pymorphy2 import opencorpora_dict file "/usr/local/lib/python2.7/site-packages/pymorphy2/opencorpora_dict/__init__.py", line 4, in <module> .storage import load_dict load file "/usr/local/lib/python2.7/site-packages/pymorphy2/opencorpora_dict/storage.py", line 24, in <module> pymorphy2.utils import json_write, json_read file "/usr/local/lib/python2.7/site-packages/pymorphy2/utils.py", line 5, in <module> import bz2 importerror: no module named bz2
ok, no problem:
sudo apt-get install libbz2-dev
and finally:
maestro@uiserver:~$ sudo apt-get install libbz2-dev reading package lists... done building dependency tree reading state information... done libbz2-dev newest version. 0 upgraded, 0 newly installed, 0 remove , 64 not upgraded. 1 not installed or removed. after operation, 0b of additional disk space used. setting python-pip (0.3.1-1ubuntu2) ... traceback (most recent call last): file "/usr/bin/pycentral", line 2196, in <module> main() file "/usr/bin/pycentral", line 2190, in main rv = action.run(global_options) file "/usr/bin/pycentral", line 1478, in run runtimes = get_installed_runtimes() file "/usr/bin/pycentral", line 279, in get_installed_runtimes default_version = pyversions.default_version(version_only=true) file "/usr/share/pycentral-data/pyversions.py", line 172, in default_version raise valueerror, "/usr/bin/python not match python default version. must reset point %s" % debian_default valueerror: /usr/bin/python not match python default version. must reset point python2.6 dpkg: error processing python-pip (--configure): subprocess installed post-installation script returned error exit status 1 errors encountered while processing: python-pip e: sub-process /usr/bin/dpkg returned error code (1)
how resolve conflict versions of python in case?
looks need create new symbolic link python 2.6.
ln -sf /usr/bin/python2.6 /usr/bin/python
Comments
Post a Comment