Sie haben Python 3.X mit Pyenv installiert
Traceback (most recent call last):
File "test.py", line 6, in <module>
from sklearn.feature_extraction.text import TfidfVectorizer
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/sklearn/__init__.py", line 57, in <module>
from .base import clone
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/sklearn/base.py", line 12, in <module>
from .utils.fixes import signature
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/sklearn/utils/__init__.py", line 18, in <module>
from ..externals.joblib import cpu_count
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/sklearn/externals/joblib/__init__.py", line 122, in <module>
from .memory import Memory, MemorizedResult
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/sklearn/externals/joblib/memory.py", line 37, in <module>
from . import numpy_pickle
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 16, in <module>
from .numpy_pickle_utils import _COMPRESSORS
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/sklearn/externals/joblib/numpy_pickle_utils.py", line 12, in <module>
import bz2
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/bz2.py", line 20, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ImportError: No module named '_bz2'
Wenn Sie googeln
$ sudo yum install bzip2-devel
Es gibt eine Lösung, aber danach müssen Sie Python selbst neu installieren.
$ pyenv install 3.4.3
$ pyenv global 3.4.3
Wird mit arbeiten.
Recommended Posts