2017-01-24 4 views
0

これは初めてのPythonのインストールです。Scikitが正しく構築されていないことを教えてください

私は上のガイド続いている: http://scikit-learn.org/stable/developers/advanced_installation.html

をし、すべてのビルドの依存関係をインストールしました。私はその後pipを使用してインストールしました: pip install scikit-learn

pipでインストールするとエラーは発生しませんでした。

私はcloud9に私の環境で正常に動作します私の予測プログラムを、実行しようとすると、私はこのエラーを取得:

[email protected]:~/api-for-ml-requests/api# Traceback (most recent call last): 
    from sklearn.feature_extraction.text import CountVectorizer 
    File "/usr/local/lib/python2.7/dist-packages/sklearn/__init__.py", line 56, in <module> 
    from . import __check_build 
    File "/usr/local/lib/python2.7/dist-packages/sklearn/__check_build/__init__.py", line 46, in <module> 
    raise_build_error(e) 
    File "/usr/local/lib/python2.7/dist-packages/sklearn/__check_build/__init__.py", line 41, in raise_build_error 
-bash: syntax error near unexpected token `most' 
[email protected]:~/api-for-ml-requests/api# File "Backend-Rest-Alpha.1.py", line 9, in <module> 
-bash: syntax error near unexpected token `newline' 
[email protected]:~/api-for-ml-requests/api#  from backend.Predictions import predict 
from: can't read /var/mail/backend.Predictions 
[email protected]:~/api-for-ml-requests/api# File "/root/api-for-ml-requests/api/backend/Predictions.py", line 1, in <module> 
-bash: syntax error near unexpected token `newline' 
[email protected]:~/api-for-ml-requests/api#  from sklearn.feature_extraction.text import CountVectorizer 
from: can't read /var/mail/sklearn.feature_extraction.text 
[email protected]:~/api-for-ml-requests/api# File "/usr/local/lib/python2.7/dist-packages/sklearn/__init__.py", line 56, in <module> 
-bash: syntax error near unexpected token `newline' 
[email protected]u-512mb-sfo1-01-PredictionAPI:~/api-for-ml-requests/api#  from . import __check_build 
[email protected]:~/api-for-ml-requests/api# File "/usr/local/lib/python2.7/dist-packages/sklearn/__check_build/__init__.py", line 46, in <module> 
-bash: syntax error near unexpected token `newline' 
[email protected]:~/api-for-ml-requests/api#  raise_build_error(e) 
-bash: syntax error near unexpected token `e' 
[email protected]:~/api-for-ml-requests/api# File "/usr/local/lib/python2.7/dist-packages/sklearn/__check_build/__init__.py", line 41, in raise_build_error 
    %s""" % (e, local_dir, ''.join(dir_content).strip(), msg)) 
ImportError: /usr/local/lib/python2.7/dist-packages/sklearn/__check_build/_check_build.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8 
___________________________________________________________________________ 
Contents of /usr/local/lib/python2.7/dist-packages/sklearn/__check_build: 
__init__.py    setup.py     setup.pyc 
_check_build.so   __init__.pyc 
___________________________________________________________________________ 
It seems that scikit-learn has not been built correctly. 

誰もがこれを引き起こしている可能性が何にようなアイデアを持っていますか?

答えて

0

https://www.continuum.io/downloads#linux これはscikit-learnとpythonとすべての依存関係とPythonでさまざまなタスクに使用される長いリストライブラリが含まれているため、問題を解決します。また、PyCharm Community EditionをIDEとして使用して、心配することなく必要なライブラリを簡単に追加できることをお勧めします。 https://www.jetbrains.com/pycharm/

0

あなたのモジュールがUSC4エンコーディングを使用しているPythonでビルドされたようですが、PythonはUSC2を使用しています。パイソンdocumentationから

Python was built using 2-byte Unicode characters, and the extension module was compiled using a Python with 4-byte Unicode characters.

This can easily occur when using pre-built extension packages.

The only way to solve this problem is to use extension modules compiled with a Python binary built using the same size for Unicode characters.

あなたはソースからパッケージをインストールしようとする必要があります。 Sklearnのハウツーについては、あなたの質問に記載されているリンクに記載されています。また、scipyスイートについては、hereという指示を見つけることができます。 Macを使用していない場合、そのページの右上のメニューにあるリンクは、WindowsとLinuxのガイドも表示します。

関連する問題