【问题标题】:How to configure and compile Samba?如何配置和编译 Samba?
【发布时间】:2017-11-28 22:52:23
【问题描述】:

我想从源代码安装 samba。我输入命令:

./configure --prefix=/usr/local

但我得到了错误:

Checking for library python2.7 : not found 
Checking for library python2.7 : not found 
Checking for library python27 : not found 
Checking for program python2.7-config : not found 
Checking for program python-config-2.7 : not found 
Checking for custom code : Could not find the python development headers 
/home/fv1/Pobrane/samba/wscript:121:
error: the configuration failed (see '/home/fv1/Pobrane/samba/bin/config.log')

这里是config.log

<==
[1/2] Compiling test.c
../test.c:2:10: fatal error: Python.h: No such file or directory
 #include "Python.h"
          ^~~~~~~~~~
compilation terminated.
['/usr/bin/gcc', '-MD', '-fno-strict-aliasing', '-I/usr/local/include', '-I/usr/include/python2.7', '-D_SAMBA_BUILD_=4', '-DHAVE_CONFIG_H=1', '-D_GNU_SOURCE=1', '-D_XOPEN_SOURCE_EXTENDED=1', '../test.c', '-c', '-o', 'default/test_1.o']
command returned 'Build failed:  -> task failed (err #1): \n\t{task: cc test.c -> test_1.o}'Could not find the python development headers

什么是问题,我该如何解决?

【问题讨论】:

  • 您是否按照指示检查了 config.log 文件?
  • @MarkJ.Bobak 我已经编辑了我的帖子
  • 好的,Python 安装了吗?如果没有,请安装它。如果它已经是,也许你缺少某种与 Python 相关的“-dev”包......
  • 另外,阅读您的错误消息,然后谷歌它们。它在 95% 的时间都有效,并且浪费了每个人的时间。

标签: python linux fedora samba


【解决方案1】:

如果你想在你的 redhat 系统上设置 samba 服务器,那么我有一个答案。

在 samba 服务器上执行以下步骤:

  1. 使用简单的命令安装 samba 服务器(epel 应该预先安装):

    yum install samba samba-client
    
  2. 像管理 samba.conf 文件

    [file]
    path = /filename
    hosts allow = ip/netmask
    
  3. 管理selinux,然后启动服务。

    systemctl restart smb nmb
    

【讨论】:

    【解决方案2】:

    试试这个: yum install python-devel

    【讨论】:

    • 欢迎来到 Stack Overflow。虽然此命令可能会回答问题,但提供有关此代码为何和/或如何回答问题的附加上下文会提高其长期价值。 How to Answer
    【解决方案3】:

    RHEL 7 和 RHEL 8 上的 Samba 没有启用域控制器功能,存在一些尴尬的依赖关系。我的 RPM 构建工具位于:

    https://github.com/nkadel/samba4repo/

    Samba 现在也需要 python3,而不仅仅是 python2。 RHEL 8 及其变体默认支持 python3,这使得编译更简单。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-24
      • 2013-11-30
      • 2013-05-10
      • 1970-01-01
      相关资源
      最近更新 更多