EasyML icon indicating copy to clipboard operation
EasyML copied to clipboard

执行时提示缺少模块,我能不能在程序打包的时候,把提示少的模块目录放到程序所在目录,一块打包。

Open leafage-autumn opened this issue 6 years ago • 1 comments

我这样试了,然后不提示缺模块了,但是其他错误。想请教下这种方式不行吗。必须手动到集群下所有机器中手动安装模块吗。日志如下:

Traceback (most recent call last):
File "Logistic_regression_demo_03.py", line 13, in
from sklearn import datasets
File "/usr/local/hadoop/tmp/nm-local-dir/usercache/root/appcache/application_1543824764893_0001/container_1543824764893_0001_01_000002/sklearn/init.py", line 63, in
from . import __check_build
File "/usr/local/hadoop/tmp/nm-local-dir/usercache/root/appcache/application_1543824764893_0001/container_1543824764893_0001_01_000002/sklearn/__check_build/init.py", line 46, in
raise_build_error(e)
File "/usr/local/hadoop/tmp/nm-local-dir/usercache/root/appcache/application_1543824764893_0001/container_1543824764893_0001_01_000002/sklearn/__check_build/init.py", line 41, in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
ImportError: No module named _check_build

Contents of /usr/local/hadoop/tmp/nm-local-dir/usercache/root/appcache/application_1543824764893_0001/container_1543824764893_0001_01_000002/sklearn/__check_build:
init.py pycache _check_build.cp36-win_amd64.pyd
setup.py init.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.
mv: cannot stat 'B6ED14D4-A27C-476E-B10D-B9A07A8D6612': No such file or directory
mv: cannot stat '98A50D03-28DF-48F1-91D6-E788D587714C': No such file or directory

谢谢,请帮忙解答下

leafage-autumn avatar Jan 07 '19 01:01 leafage-autumn

@leafage-autumn 上面那个代码你只是Import了sklearn的包。但是实际上docker容器中的python环境默认没有安装这个包。所以还是需要到各个节点中手动安装下sklearn

sinllychen avatar Jan 09 '19 02:01 sinllychen