在Mac上安装python xgboost [英] python xgboost on mac install

查看:152
本文介绍了在Mac上安装python xgboost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Mac上为Python 3.4安装xgboost,但在pip3 setup.py install之后出现以下错误:

I am trying to install xgboost on my Mac for Python 3.4 but I'm getting the following error after pip3 setup.py install:

  File "<string>", line 20, in <module>

  File "/private/var/folders/_x/rkkz7tjj42g9n8lqq5r0ry000000gn/T/pip-build-2dc6bwf7/xgboost/setup.py", line 28, in <module>

    execfile(libpath_py, libpath, libpath)

NameError: name 'execfile' is not defined

使用-v选项运行它以获取详细输出时,错误如下所示:

When running it with the -v option to get the verbose output the error looks like this:

  Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/_x/rkkz7tjj42g9n8lqq5r0ry000000gn/T/pip-build-2dc6bwf7/xgboost
Exception information:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/basecommand.py", line 232, in main
    status = self.run(options, args)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/commands/install.py", line 339, in run
    requirement_set.prepare_files(finder)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/req/req_set.py", line 385, in prepare_files
    req_to_install.run_egg_info()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/req/req_install.py", line 358, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/utils/__init__.py", line 749, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/_x/rkkz7tjj42g9n8lqq5r0ry000000gn/T/pip-build-2dc6bwf7/xgboost

我该如何解决这个问题?

How can I solve this issue?

推荐答案

这对我有用.

OS:OSX El Capitan

OS: OSX El Capitan

步骤1:cd xgboost; ./build.sh
步骤2:cd python-package; python setup.py install

Step-1: cd xgboost; ./build.sh
Step-2: cd python-package; python setup.py install

这篇关于在Mac上安装python xgboost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆