广告
返回顶部
首页 > 资讯 > 后端开发 > Python >解决:centos安装python-my
  • 271
分享到

解决:centos安装python-my

centospython 2023-01-31 02:01:26 271人浏览 八月长安

Python 官方文档:入门教程 => 点击学习

摘要

使用命令pip install mysql-python的时候报错    _Mysql.c:2722: warning: implicit declaration of function ‘PyMember_Set’    _mysql.c

使用命令pip install mysql-python的时候报错


    _Mysql.c:2722: warning: implicit declaration of function ‘PyMember_Set’

    _mysql.c: At top level:

    _mysql.c:2739: error: expected declaration specifiers or ‘...’ before ‘PyObject’

    _mysql.c: In function ‘_mysql_ResultObject_setattr’:

    _mysql.c:2741: error: ‘v’ undeclared (first use in this function)

    _mysql.c:2742: error: ‘PyExc_AttributeError’ undeclared (first use in this function)

    _mysql.c: At top level:

    _mysql.c:2760: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’

    _mysql.c:2848: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’

    _mysql.c:2938: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_methods’

    _mysql.c:3010: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token

    _mysql.c:3058: warning: return type defaults to ‘int’

    _mysql.c: In function ‘DL_EXPORT’:

    _mysql.c:3058: error: expected declaration specifiers before ‘init_mysql’

    _mysql.c:3166: error: expected ‘{’ at end of input

    error: command 'GCc' failed with exit status 1

    

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

Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-1dNMXc/mysql-Python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-YhSNnU-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1dNMXc/mysql-python

解决方法:


在安装MySQLdb前安装以下依赖库:

yum install python-devel mysql-devel zlib-devel openssl-devel

依赖库装好之后,执行pip install mysql-python

--结束END--

本文标题: 解决:centos安装python-my

本文链接: https://www.lsjlt.com/news/186479.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • 解决:centos安装python-my
    使用命令pip install mysql-python的时候报错    _mysql.c:2722: warning: implicit declaration of function ‘PyMember_Set’    _mysql.c...
    99+
    2023-01-31
    centos python
  • CentOS安装Python
    cd /usr/local/src/          #安装在这wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xztar -xvJf Python-3.5.1....
    99+
    2023-01-31
    CentOS Python
  • Centos 6.4 安装python
    Centos自带的python版本太低,所以自己编译安装下python 2.7.10安装需要的包:[root@python ~]# yum -y install wget[root@python ~]# yum -y install gcc...
    99+
    2023-01-31
    Centos python
  • centos安装errorpopulating问题怎么解决
    "Error populating" 是CentOS安装过程中可能遇到的一个错误消息,它通常与安装源或网络连接有关。在解决此问题之前...
    99+
    2023-09-22
    centos
  • centos下安装python mysq
    yum -y install mysql-devel python-devel -ytar zxf MySQL-python-1.2.4b4.tar.gzcd MySQL-python-1.2.4b4python setup.py buil...
    99+
    2023-01-31
    centos python mysq
  • 在Centos下安装python
    1.下载python包 wget https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz 2.下载python3编译的依赖包 yum install -y ...
    99+
    2023-04-19
    Centos python Centos安装python
  • CentOS中安装Python-PIP
     首先要安装 Setuptools wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg sh setuptools-0.6c11...
    99+
    2023-01-31
    CentOS Python PIP
  • CentOS 7 下安装 Python
    当前最新的 CentOS 7.3 默认安装的是 Python 2 ,并且默认的官方 yum 源中不提供 Python 3 的安装包。最近需要在机器上装awscli,需要python2.6.5+或python3.3+,python3我这边通...
    99+
    2023-01-31
    CentOS Python
  • CentOS安装pillow报错的解决方法
    安装pillow出现以下问题: ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, abortin...
    99+
    2022-06-04
    报错 解决方法 CentOS
  • window-64安装python-my
    第一步:    安装MySQL-python-1.2.3.win-amd64-py2.7.exe    下载地址:http://www.codegood.com/archives/129     如果不安装这个驱动,会报以下错误:    _...
    99+
    2023-01-31
    window python
  • CentOS 6.9编译安装python
    Python官网:https://www.python.org/一、查看CentOS版本和系统默认Python版本:# cat /etc/redhat-release# python -V 二、编译安装Python-3.6.1:1、安装依赖...
    99+
    2023-01-31
    CentOS python
  • CentOS 7上安装Python 3.
    CentOS 7默认安装了Python 2.7,系统本身也使用它来启用系统命令例如‘yum’ 虽然作为开发人员我可以用Python 2.7做很多事情,但我真的想要利用Python 3附带的新语言功能。自从Python 3.6在去年年底问世以...
    99+
    2023-01-31
    CentOS Python
  • Centos 编译安装Python 2.
    Linux 系统是自带python的. 但是一般的版本都比较低  (CentOS5.6 带的python2.4版本)如果需要使用高版本的python 则需要自己 编译并安装编译python 前需要先安装 编译环境使用  yum instal...
    99+
    2023-01-31
    Centos Python
  • Centos 7 安装python 版本
    #/root/.pyenv/shims/python     #python 3.0 # -*- coding:UTF-8 -*- import os import sys class Package():     def install...
    99+
    2023-01-31
    版本 Centos python
  • CentOS 编译安装 python 3
    CentOS 6自带的python是2.6的,下面记录下CentOS6源码安装python 3.5的过程 #wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz #tar...
    99+
    2023-01-31
    CentOS python
  • CentOS版本安装Docker报错如何解决
    本篇内容主要讲解“CentOS版本安装Docker报错如何解决”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“CentOS版本安装Docker报错如何解决”吧!1...
    99+
    2022-10-19
  • CentOS 6编译安装python 3
    Python官网:https://www.python.org/一、查看CentOS版本和系统默认Python版本:# cat /etc/redhat-release# python -V 二、编译安装Python-3.6.1:1、安装依赖...
    99+
    2023-01-31
    CentOS python
  • CENTOS 安装python双版本(2
    CentOS6使用Python2.6.6作为系统默认的python,几个关键的系统实用程序都是以它作为开发语言的,例如yum,如果对默认的Python解释器进行升级将使得这是程序无法使用。所有关键是要把其他版本的Python安装的在/usr...
    99+
    2023-01-31
    版本 CENTOS python
  • Vmware虚拟机中CentOS安装 CentOS安装Qt的教程图解
    Vmware安装 安装包   下载地址:https://www.wlrjy.com/Soft/89658.html 安装教程   Vmware版本可以百度搜索下载,有的镜像可能需要更高版本的Vmware CentOS安装...
    99+
    2022-06-04
    Vmware虚拟机CentOS安装 CentOS安装Qt
  • 怎么解决CentOs 7.X安装Oracle 11g RAC的坑
    本篇内容主要讲解“怎么解决CentOs 7.X安装Oracle 11g RAC的坑”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“怎么解决CentOs 7.X安装...
    99+
    2022-10-18
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作