Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

    开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

    如果您登录系统碰到问题,请在微信公众号留言:

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

    Odoo 安装指南
    5
    9
    16225
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      ssssyn last edited by

      环境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 Reply Last reply Reply Quote 0
      • W
        wangbuke last edited by

        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 Reply Last reply Reply Quote 0
        • S
          ssssyn last edited by

          [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 Reply Last reply Reply Quote 0
          • W
            wangbuke last edited by

            您的python 环境没有问题。

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

            如运行:
            [email protected]:~/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 Reply Last reply Reply Quote 0
            • K
              kitkitsuper last edited by

              我使用 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 Reply Last reply Reply Quote 0
              • J
                jinxiu89163.com last edited by

                yum install python-dev -y
                
                1 Reply Last reply Reply Quote 0
                • N
                  nilm61 last edited by

                  [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 版本信息如下

                  [[email protected] 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.


                  错误大致如下:

                  [[email protected] 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 Reply Last reply Reply Quote 0
                  • J
                    jinxiu89163.com last edited by

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

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post