我分叉了scikit-learn repository,添加了一個我需要的文件並下載了存儲庫。我不知道如何使用這個custom library。我cd'ed scikit學習主文件夾,並試圖使用它,但它會引發錯誤。所以在閱讀我使用python3 setup.py install
安裝它的錯誤之後。有兩個setup.py
文件。一個在scikit-learn-master
文件夾和sklearn
文件夾中,因此我在這兩個位置都運行了python3 setup.py install
。他們拋出一些警告,但沒有錯誤。我打開蟒蛇終端在scikit-learn-master
文件夾,並使用import sklearn
返回如下 -安裝自定義sklearn
Traceback (most recent call last):
File "/Users/shubhamgandhi/Desktop/scikit-learn-master/sklearn/__check_build/__init__.py", line 44, in <module>
from ._check_build import check_build # noqa
ModuleNotFoundError: No module named 'sklearn.__check_build._check_build'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/shubhamgandhi/Desktop/scikit-learn-master/sklearn/__init__.py", line 128, in <module>
from . import __check_build
File "/Users/shubhamgandhi/Desktop/scikit-learn-master/sklearn/__check_build/__init__.py", line 46, in <module>
raise_build_error(e)
File "/Users/shubhamgandhi/Desktop/scikit-learn-master/sklearn/__check_build/__init__.py", line 41, in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
ImportError: No module named 'sklearn.__check_build._check_build'
___________________________________________________________________________
Contents of /Users/shubhamgandhi/Desktop/scikit-learn-master/sklearn/__check_build:
__init__.py __pycache__ _check_build.c
_check_build.pyx setup.py setup.pyc
___________________________________________________________________________
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
我不知道如何着手。有什麼我失蹤?
我使用'numpy.version.version'和'scipy.version.version'檢查了scipy和numpy的版本。它爲python2和python3提供了'1.13.1'和'0.19.1'。我使用Python 2.7.10(...'和python'3.6.0(...'。我想還有其他東西我在這裏丟失。 –
@ClockSlave嗨,所以我安裝了它 - 當我運行'在python shell中import sklearn沒有錯誤,我在Fedora上,我用的步驟是'sudo dnf install python-numpy','dnf install python-scipy'和'dnf install python-scikit-learn'。建議刪除分叉的回購和安裝通過命令行,如果你在Linux上。希望它有幫助。 – nj2237
感謝您花時間檢查這個。我可以使用安裝sklearn使用點或家庭釀造,但我試圖使用分叉回購是因爲我已經添加了一個文件分叉repo。我想檢查它是否按預期運行。事實上,我已經安裝了原始sklearn軟件包。它的分叉回購,我需要安裝並檢查我的代碼是正確的 –