错误:此平台不支持MySQL_python-1.2.5-cp27-none-win_amd64.whl

问题描述 投票:0回答:1

因此,我建立了一个旧项目,即Python 2和Django 1,我一直坚持安装requirement.txt。这是我在安装时遇到的主要错误

 Building wheel for MySQL-python (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/rehman/projects/comparedjs/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KyvPG6/MySQL-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KyvPG6/MySQL-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-jCT7NK
       cwd: /tmp/pip-install-KyvPG6/MySQL-python/
  Complete output (38 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
  creating build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  running build_ext
  building '_mysql' extension
  creating build/temp.linux-x86_64-2.7
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
  In file included from _mysql.c:44:
  /usr/include/mariadb/my_config.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp]
   #warning This file should not be included by clients, include only <mysql.h>
    ^~~~~~~
  In file included from _mysql.c:46:
  /usr/include/mariadb/mysql.h:444:3: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
     MYSQL_CLIENT_PLUGIN_HEADER
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
  _mysql.c: In function ‘_mysql_ConnectionObject_ping’:
  _mysql.c:2005:41: error: ‘MYSQL’ {aka ‘struct st_mysql’} has no member named ‘reconnect’
    if ( reconnect != -1 ) self->connection.reconnect = reconnect;
                                           ^
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for MySQL-python
  Running setup.py clean for MySQL-python
  Building wheel for torctl (setup.py) ... done
  Created wheel for torctl: filename=torctl-0.2-py2-none-any.whl size=67317 sha256=3cfc42c3313ca9a9b220dc844f65156a0134bb5c7f63dba0327fefe57fb64705
  Stored in directory: /tmp/pip-ephem-wheel-cache-M4548v/wheels/c4/3a/87/1d604378e37b4c4d4c07b26c7866955102de8d824553cec0ec
Successfully built torctl
Failed to build MySQL-python
Installing collected packages: Django, pycrypto, six, ecdsa, paramiko, Fabric, GeoIP, Markdown, MySQL-python, Pillow, Unidecode, amqp, anyjson, beautifulsoup4, billiard, pytz, kombu, celery, colorama, configobj, django-celery, django-filter, django-mailchimp-v1.3, djangorestframework, httplib2, uritemplate, pyasn1, rsa, pyasn1-modules, oauth2client, google-api-python-client, html5lib, meld3, mysql-connector, oauth2, python-Levenshtein, python-dateutil, redis, requests, stripe, supervisor, urllib3, vine, pyyaml, ua-parser, user-agents, django-user-agents, contextlib2, raven, enum34, ipaddress, pycparser, cffi, cryptography, PyOpenSSL, ndg-httpsclient, pycryptodomex, future, pyjwkest, python-openid, oauthlib, requests-oauthlib, PyJWT, social-auth-core, social-auth-app-django, django-js-asset, django-ckeditor, django-compat, django-hijack, django-hijack-admin, torctl
    Running setup.py install for MySQL-python ... error
    ERROR: Command errored out with exit status 1:
     command: /home/rehman/projects/comparedjs/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KyvPG6/MySQL-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KyvPG6/MySQL-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-nSvXLQ/install-record.txt --single-version-externally-managed --compile --install-headers /home/rehman/projects/comparedjs/include/site/python2.7/MySQL-python
         cwd: /tmp/pip-install-KyvPG6/MySQL-python/
    Complete output (38 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
    creating build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    running build_ext
    building '_mysql' extension
    creating build/temp.linux-x86_64-2.7
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
    In file included from _mysql.c:44:
    /usr/include/mariadb/my_config.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp]
     #warning This file should not be included by clients, include only <mysql.h>
      ^~~~~~~
    In file included from _mysql.c:46:
    /usr/include/mariadb/mysql.h:444:3: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
       MYSQL_CLIENT_PLUGIN_HEADER
       ^~~~~~~~~~~~~~~~~~~~~~~~~~
    _mysql.c: In function ‘_mysql_ConnectionObject_ping’:
    _mysql.c:2005:41: error: ‘MYSQL’ {aka ‘struct st_mysql’} has no member named ‘reconnect’
      if ( reconnect != -1 ) self->connection.reconnect = reconnect;
                                             ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/rehman/projects/comparedjs/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KyvPG6/MySQL-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KyvPG6/MySQL-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-nSvXLQ/install-record.txt --single-version-externally-managed --compile --install-headers /home/rehman/projects/comparedjs/include/site/python2.7/MySQL-python Check the logs for full command output.

这是requirement.txt

Django==1.9.7
Fabric==1.11.1
GeoIP==1.3.2
Markdown==2.6.6
MySQL-python==1.2.5
Pillow==3.3.0
Unidecode==0.04.19
amqp==1.4.9
anyjson==0.3.3
argparse==1.2.1
beautifulsoup4==4.2.1
billiard==3.3.0.22
celery==3.1.18
colorama==0.2.5
configobj
django-celery==3.1.17
django-filter==0.13.0
django-mailchimp-v1.3==1.4.0
djangorestframework==3.4.1
google-api-python-client==1.6.2
html5lib==0.999
httplib2==0.10.3
kombu==3.0.37
#newspaper == 0.1.0.7
meld3==1.0.2
mysql-connector
oauth2
oauth2client
#pyinotify
#pyserial
python-Levenshtein
python-dateutil
redis
requests==2.9.1
six==1.10.0
#ssh-import-id
stripe==1.46.0
supervisor==3.2.1
git+https://github.com/aaronsw/pytorctl.git
uritemplate==3.0.0
urllib3==1.7.1
vine==1.1.3
wsgiref==0.1.2
#zope.interface==4.0.5
pyyaml
ua-parser
user-agents
django-user-agents
raven
pyasn1
ndg-httpsclient
pyjwkest
social-auth-app-django
social-auth-core
django-ckeditor==5.4.0
django-hijack
django-hijack-admin

[我搜索后得到的线索表明它与方向盘有些相关,这是导致问题的原因,通过此link,我知道我需要下载.whl文件并手动将其提取以用于MySQL-python,所以我通过this链接找到2个文件,当我尝试通过pip install MySQL_python-1.2.5-cp27-none-win32.whl执行.whl文件时,出现错误ERROR: MySQL_python-1.2.5-cp27-none-win_amd64.whl is not a supported wheel on this platform

我最终想出了它的Windows平台。因此,如果mysql-python用于Windows平台,那么我应该为Linux安装什么?我正在使用Debian 10。

python mysql django linux python-2.7
1个回答
1
投票

只需安装mysqlclient而不是MySQL-python,它是一种易于维护的替代产品。

© www.soinside.com 2019 - 2024. All rights reserved.