python xgboost 在 mac 安装

标签 python macos installation xgboost

我正在尝试在我的 Mac 上为 Python 3.4 安装 xgboost,但在 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 选项运行它以获得详细输出时,错误如下所示:

  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

我该如何解决这个问题?

最佳答案

这对我有用。

操作系统:OSX El Capitan

第一步:cd xgboost; ./build.sh
第 2 步:cd python-package; python setup.py 安装

关于python xgboost 在 mac 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32838959/

相关文章:

python - 将列表项与上一项连接

python - 'object oriented' python中的错误处理

c - 在 OSX 上为 ICU 核心生成或查找 C 头文件

java - 将 miglayout 与 netbeans 结合使用

ios - 如果 iPhone 上安装了应用程序,请在 Safari 中检查

postgresql - 在Apache Airflow中实现Postgres Sql

Python Beautiful soup 在html中插入注释

python - PyAudio stream.is_active(),它是如何知道自己是否活跃的

php - 出现错误 zsh : permission denied: composer

c++ - 如何在VSCode上调试C++代码?苹果系统