Error: setup script specifies an absolute path

本文介绍了一种在安装sklearn过程中遇到的错误及其解决方案。错误表现为setup script指定了绝对路径,而非相对于setup.py目录的相对路径。通过将setup.py文件中的include_package_data参数设置为False并重新运行安装命令,可以成功解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在安装sklearn的时候,出现:

        error: Error: setup script specifies an absolute path:

        /opt/xgboost-0.47/python-package/xgboost/../../wrapper/libxgboostwrapper.so

        setup() arguments must *always* be /-separated paths relative to the
        setup.py directory, *never* absolute paths.

 

解决方法:

  在setup.py中,修改:

  include_package_data=False(原来是True)

  再次运行python setup.py install,安装即可。

转载于:https://www.cnblogs.com/hbwxcw/p/7086188.html

ERROR [ 5%] test setup failed name = '__init__', package = None def import_module(name, package=None): """Import a module. The 'package' argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import. """ level = 0 if name.startswith('.'): if not package: msg = ("the 'package' argument is required to perform a relative " "import for {!r}") raise TypeError(msg.format(name)) for character in name: if character != '.': break level += 1 > return _bootstrap._gcd_import(name[level:], package, level) C:\Users\ADMIN\Anaconda3\envs\paddle_env\lib\importlib\__init__.py:127: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > from .paddleocr import ( PaddleOCR, PPStructure, draw_ocr, draw_structure_result, save_structure_res, download_with_progressbar, sorted_layout_boxes, convert_info_docx, to_excel, ) E ImportError: attempted relative import with no known parent package ..\__init__.py:14: ImportError The above exception was the direct cause of the following exception: cls = <class '_pytest.runner.CallInfo'> func = <function call_and_report.<locals>.<lambda> at 0x000001800A722430> when = 'setup' reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>) @classmethod def from_call( cls, func: Callable[[], TResult], when: Literal["collect", "setup", "call", "teardown"], reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None, ) -> CallInfo[TResult]: """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called wi
03-27
~/catkin_ws$ catkin build ----------------------------------------------------------- Profile: default Extending: [cached] /opt/ros/noetic Workspace: /home/ubuntu/catkin_ws ----------------------------------------------------------- Build Space: [exists] /home/ubuntu/catkin_ws/build Devel Space: [exists] /home/ubuntu/catkin_ws/devel Install Space: [unused] /home/ubuntu/catkin_ws/install Log Space: [exists] /home/ubuntu/catkin_ws/logs Source Space: [exists] /home/ubuntu/catkin_ws/src DESTDIR: [unused] None ----------------------------------------------------------- Devel Space Layout: linked Install Space Layout: None ----------------------------------------------------------- Additional CMake Args: None Additional Make Args: None Additional catkin Make Args: None Internal Make Job Server: True Cache Job Environments: False ----------------------------------------------------------- Buildlisted Packages: None Skiplisted Packages: None ----------------------------------------------------------- Workspace configuration appears valid. ----------------------------------------------------------- [build] Found 6 packages in 0.0 seconds. [build] Package table is up to date. Starting >>> mavlink Starting >>> mavros_msgs Finished <<< mavlink [ 8.6 seconds ] Starting >>> libmavconn Finished <<< mavros_msgs [ 15.3 seconds ] Finished <<< libmavconn [ 44.3 seconds ] Starting >>> mavros _______________________________________________________________________________ Errors << mavros:cmake /home/ubuntu/catkin_ws/logs/mavros/build.cmake.000.log CMake Error at /home/ubuntu/catkin_ws/devel/share/libmavconn/cmake/libmavconnConfig.cmake:113 (message): Project 'libmavconn' specifies '/include' as an include dir, which is not found. It does neither exist as an absolute directory nor in '/home/ubuntu/catkin_ws/src/mavros/libmavconn//include'. Check the issue tracker 'https://github.com/mavlink/mavros/issues' and consider creating a ticket if the problem has not been reported yet. Call Stack (most recent call first): /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package) CMakeLists.txt:7 (find_package) cd /home/ubuntu/catkin_ws/build/mavros; catkin build --get-env mavros | catkin env -si /bin/cmake /home/ubuntu/catkin_ws/src/mavros/mavros --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/ubuntu/catkin_ws/devel/.private/mavros -DCMAKE_INSTALL_PREFIX=/home/ubuntu/catkin_ws/install; cd - ............................................................................... Failed << mavros:cmake [ Exited with code 1 ] Failed <<< mavros [ 6.2 seconds ] Abandoned <<< mavros_extras [ Unrelated job failed ] Abandoned <<< test_mavros [ Unrelated job failed ] [build] Summary: 3 of 6 packages succeeded. [build] Ignored: None. [build] Warnings: None. [build] Abandoned: 2 packages were abandoned. [build] Failed: 1 packages failed. [build] Runtime: 1 minute and 5.3 seconds total. [build] Note: Workspace packages have changed, please re-source setup files to use them.
最新发布
08-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值