跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 安装指南
  4. 已解决:centos6/Python2.7.安装6.1版报command 'gcc' failed 怎么解决

已解决:centos6/Python2.7.安装6.1版报command 'gcc' failed 怎么解决

已定时 已固定 已锁定 已移动 Odoo 安装指南
9 帖子 5 发布者 16.7k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • S 离线
    S 离线
    ssssyn
    写于 最后由 编辑
    #1

    环境centos6,64,因为在python2.6.6的时候报一个错(具体记不清了),坛子里说是python版本问题,就升级到了python2.7.3。

    然后再安装的时候报error: Setup script exited with error: command 'gcc' failed with exit status 1

    python-devel已经升级到最新版了,gcc也是最新版,但python-dev是2.6.6了,网上查源,没有给centos2.7的,不知道大家是否遇到过?们有什么办法么?

    还是我必须降级python~~~~

    提前拜谢


    ------------------------------------------------------------------------------------------------------

    问题还是gcc安装有问题

    重新安装显示kernel-2.6.32-220.13.1.el6.x86_64 has missing requires of kernel-firmware >= ('0', '2.6.32', '220.13.1.el6')

    后来百度,是阿里云服务器问题,修改文件vi /etc/yum.conf 将exclude=kernel*前加注释即可解决

    然后重装GCC,问题得到解决

    1 条回复 最后回复
    0
    • W 离线
      W 离线
      wangbuke
      写于 最后由 编辑
      #2

      oe python> 2.5 就可以用, 但不兼容3.X

      你需要安装的是 python 的解释器,
      $ sudo yum install python

      安装完之后, 运行
      $ python
      Python 2.7.3rc2 (default, Apr 22 2012, 22:30:17)
      [GCC 4.6.3] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>>
      即为安装正确。

      python-devel 是 python 的 c header 文件,开发PYTHON C扩展用的。 和运行PY没有任何关系。

      1 条回复 最后回复
      0
      • S 离线
        S 离线
        ssssyn
        写于 最后由 编辑
        #3

        [quote author=wangbuke link=topic=4338.msg11884#msg11884 date=1346651025]
        oe python> 2.5 就可以用, 但不兼容3.X

        你需要安装的是 python 的解释器,
        $ sudo yum install python

        安装完之后, 运行
        $ python
        Python 2.7.3rc2 (default, Apr 22 2012, 22:30:17)
        [GCC 4.6.3] on linux2
        Type "help", "copyright", "credits" or "license" for more information.
        >>>
        即为安装正确。

        python-devel 是 python 的 c header 文件,开发PYTHON C扩展用的。 和运行PY没有任何关系。
        [/quote]

        您好,我运行了python,显示如下

        Python 2.7.3 (default, Sep  1 2012, 19:50:51)
        [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
        Type "help", "copyright", "credits" or "license" for more information.
        >>>

        我想是正常的吧,我安装是参照这个帖子的方法<br / [检测到链接无效,已移除] br />
        在执行python setup.py install 时
        依然报错
        error: Setup script exited with error: command 'gcc' failed with exit status 1


        不知道是否还有可能是别的原因?还是我需要升级到2.7.3RC2?

        1 条回复 最后回复
        0
        • W 离线
          W 离线
          wangbuke
          写于 最后由 编辑
          #4

          您的python 环境没有问题。

          setup.py 是python 打包安装工具,打包为 python 的 egg 包并安装。
          但python 文件是可以直接运行的,不一定需要打包安装的。(不像其他C或C++程序是需要编译的)

          如运行:
          xxx@debian:~/Projects/openerp-6.1-20120810-233427$ ./openerp-server -c openerp-server.conf
          可以搜索参考论坛里源码运行的例子

          至于您所遇上的 gcc 错误,我在debian 测试没有问题。
          可以考虑卸载并重新安装gcc ,然后安装oe 所需要的依赖包。详细的依赖包在您下载的openerp-6.1-20120810-233427/debian/control 文件中。

          good luck ~

          1 条回复 最后回复
          0
          • K 离线
            K 离线
            kitkitsuper
            写于 最后由 编辑
            #5

            我使用 centos 6.3 64bit+ python 2.6 + openerp 6.1 (VM)有遇到你的情況
            找了一陣, 是因為小了一個lib...
            我記得我是 python-Idap 有問題的, 你把你的 問題都貼出來好嗎 ?

            結果我亂下載 yum install python-ldap
            python-devel
            到 http://pypi.python.org/simple/python-ldap/ 下載 2.4.4

            又下載了 easy_install lxml>2.0
            又要載了 libldap2-devel

            好像就解決 .. 接住來的要下載 python-devel ...來解決那個 DB connect 的問題

            1 条回复 最后回复
            0
            • J 离线
              J 离线
              jinxiu89163.com
              写于 最后由 编辑
              #6
              yum install python-dev -y
              
              1 条回复 最后回复
              0
              • N 离线
                N 离线
                nilm61
                写于 最后由 编辑
                #7

                [quote author=kitkitsuper link=topic=4338.msg11971#msg11971 date=1348819189]
                我使用 centos 6.3 64bit+ python 2.6 + openerp 6.1 (VM)有遇到你的情況
                找了一陣, 是因為小了一個lib...
                我記得我是 python-Idap 有問題的, 你把你的 問題都貼出來好嗎 ?

                結果我亂下載 yum install python-ldap
                python-devel
                到 http://pypi.python.org/simple/python-ldap/ 下載 2.4.4

                又下載了 easy_install lxml>2.0
                又要載了 libldap2-devel

                好像就解決 .. 接住來的要下載 python-devel ...來解決那個 DB connect 的問題
                [/quote]


                我的也是在安装python-Idap时出现了类似的问题!其他安装正常 属于gcc 问题不?

                python 版本信息如下

                [root@localhost source]# python
                Python 2.7.3 (default, Jan 17 2013, 22:12:59)
                [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
                Type "help", "copyright", "credits" or "license" for more information.


                错误大致如下:

                [root@localhost source]# sudo  easy_install python-ldap
                Searching for python-ldap
                Reading http://pypi.python.org/simple/python-ldap/ br />Reading http://www.python-ldap.org/ br />Best match: python-ldap 2.4.10
                Downloading http://pypi.python.org/packages/source/p/python-ldap/python-ldap-2.4.10.tar.gz#md5=a15827ca13c90e9101e5e9405c1d83be br />Processing python-ldap-2.4.10.tar.gz
                Writing /tmp/easy_install-R_K7m0/python-ldap-2.4.10/setup.cfg
                Running python-ldap-2.4.10/setup.py -q bdist_egg --dist-dir /tmp/easy_install-R_K7m0/python-ldap-2.4.10/egg-dist-tmp-V1Ndl7
                defines: HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
                extra_compile_args:
                extra_objects:
                include_dirs: /opt/openldap-RE24/include /usr/include/sasl /usr/include
                library_dirs: /opt/openldap-RE24/lib /usr/lib
                libs: ldap_r
                file Lib/ldap.py (for module ldap) not found
                file Lib/ldap/controls.py (for module ldap.controls) not found
                file Lib/ldap/extop.py (for module ldap.extop) not found
                file Lib/ldap/schema.py (for module ldap.schema) not found
                warning: no files found matching 'Makefile'
                warning: no files found matching 'Modules/LICENSE'
                file Lib/ldap.py (for module ldap) not found
                file Lib/ldap/controls.py (for module ldap.controls) not found
                file Lib/ldap/extop.py (for module ldap.extop) not found
                file Lib/ldap/schema.py (for module ldap.schema) not found
                file Lib/ldap.py (for module ldap) not found
                file Lib/ldap/controls.py (for module ldap.controls) not found
                file Lib/ldap/extop.py (for module ldap.extop) not found
                file Lib/ldap/schema.py (for module ldap.schema) not found
                在包含自 Modules/LDAPObject.c:9 的文件中:
                Modules/errors.h:8:18: 错误:lber.h:没有那个文件或目录
                Modules/errors.h:9:18: 错误:ldap.h:没有那个文件或目录
                In file included from Modules/LDAPObject.c:9:
                Modules/errors.h:12: 错误:expected ‘)’ before ‘’ token
                在包含自 Modules/LDAPObject.c:11 的文件中:
                Modules/LDAPObject.h:12:2: 错误:#error Current python-ldap requires OpenLDAP 2.x
                In file included from Modules/LDAPObject.c:11:
                Modules/LDAPObject.h:23: 错误:expected specifier-qualifier-list before ‘LDAP’
                Modules/LDAPObject.h:31: 错误:expected ‘)’ before ‘
                ’ token
                In file included from Modules/LDAPObject.c:12:
                Modules/ldapcontrol.h:11: 错误:expected ‘)’ before ‘*’ token
                Modules/ldapcontrol.h:12: 错误:expected declaration specifiers or ‘...’ before ‘LDAPControl’
                .
                .
                .
                Modules/LDAPObject.c:1305: 错误:‘LDAP_SUCCESS’ 未声明 (在此函数内第一次使用)
                Modules/LDAPObject.c:1306: 错误:‘LDAPObject’ 没有名为 ‘ldap’ 的成员
                Modules/LDAPObject.c:1306: 警告:返回时将整数赋给指针,未作类型转换
                Modules/LDAPObject.c:1270: 警告:未使用的变量 ‘reqvalue’
                error: Setup script exited with error: command 'gcc' failed with exit status 1

                请问该怎么解决,谢谢!!



                1 条回复 最后回复
                0
                • J 离线
                  J 离线
                  jinxiu89163.com
                  写于 最后由 编辑
                  #8

                  楼主出现的这个问题,我刚才也遇到了,不过我分析了一下,然后解决了,是由于Python-ldap 的问题,
                  楼主直接 yum install pyhon-ldap
                  然后在Python setup.py test 测试一下,不出意外应该不会再报 ”command 'gcc' failed with exit status“ 了

                  1 条回复 最后回复
                  0

                  • 登录

                  • 没有帐号? 注册

                  • 登录或注册以进行搜索。
                  • 第一个帖子
                    最后一个帖子
                  0
                  • 版块
                  • 标签
                  • 热门
                  • 用户
                  • 群组