【问题标题】:I'm getting the below error while installing MySQL Python packages in anaconda environment在 anaconda 环境中安装 MySQL Python 包时出现以下错误
【发布时间】:2021-08-09 13:49:06
【问题描述】:
UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment:

Specifications:

  - mysql-connector-python -> python[version='>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0']
  - mysql-python -> python[version='>=2.7,<2.8.0a0']

Your python: python=3.8

If python is on the left-most side of the chain, that's the version you've asked for. When python appears to the right, that indicates that the thing on the left is somehow not available for the python version you are constrained to. Note that conda will not change your python version to a different minor version unless you explicitly specify that.

The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package vs2015_runtime conflicts for:
mysql-connector-c -> vs2015_runtime[version='>=14.16.27012,<15.0a0']
pymysql -> cryptography -> vs2015_runtime[version='>=14.16.27012,<15.0a0']
python=3.8 -> vs2015_runtime[version='>=14.16.27012,<15.0a0']
python=3.8 -> vc[version='>=14.1,<15.0a0'] -> vs2015_runtime[version='>=14.15.26706|>=14.27.29016|>=14.16.27012']
mysql-connector-python -> vc[version='>=14.1,<15.0a0'] -> vs2015_runtime[version='>=14.0.25123,<15.0a0|>=14.0.25420|>=14.15.26706|>=14.27.29016|>=14.16.27012']
mysql-connector-python -> vs2015_runtime[version='>=14.16.27012,<15.0a0']
mysql-python -> mysql-connector-c[version='>=6.1.11,<6.1.12.0a0'] -> vs2015_runtime[version='>=14.16.27012,<15.0a0']
mysql-connector-c -> vc[version='>=14.1,<15.0a0'] -> vs2015_runtime[version='>=14.0.25123,<15.0a0|>=14.0.25420|>=14.15.26706|>=14.27.29016|>=14.16.27012']

Package six conflicts for:
mysql-connector-python -> protobuf[version='>=3.0.0'] -> six
pymysql -> cryptography -> six[version='>=1.4.1']

Package vc conflicts for:
mysql-python -> vc=9
mysql-python -> mysql-connector-c[version='>=6.1.11,<6.1.12.0a0'] -> vc[version='14.*|>=14.1,<15.0a0']

Package openssl conflicts for:
python=3.8 -> openssl[version='>=1.1.1d,<1.1.2a|>=1.1.1e,<1.1.2a|>=1.1.1f,<1.1.2a|>=1.1.1g,<1.1.2a|>=1.1.1j,<1.1.2a|>=1.1.1k,<1.1.2a']
mysql-connector-python -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a|>=1.1.1b,<1.1.2a|>=1.1.1c,<1.1.2a|>=1.1.1d,<1.1.2a|>=1.1.1e,<1.1.2a|>=1.1.1f,<1.1.2a|>=1.1.1g,<1.1.2a|>=1.1.1j,<1.1.2a|>=1.1.1k,<1.1.2a']
pymysql -> cryptography -> openssl[version='1.0.*|>=1.0.2o,<1.0.3a|>=1.0.2p,<1.0.3a|>=1.1.1a,<1.1.2a|>=1.1.1b,<1.1.2a|>=1.1.1c,<1.1.2a|>=1.1.1d,<1.1.2a|>=1.1.1g,<1.1.2a|>=1.1.1h,<1.1.2a|>=1.1.1i,<1.1.2a|>=1.1.1j,<1.1.2a|>=1.1.1k,<1.1.2a|>=1.0.2n,<1.0.3a|>=1.0.2m,<1.0.3a|>=1.1.1f,<1.1.2a|>=1.1.1e,<1.1.2a']

Package ca-certificates conflicts for:
mysql-python -> python[version='>=2.7,<2.8.0a0'] -> ca-certificates
python=3.8 -> openssl[version='>=1.1.1k,<1.1.2a'] -> ca-certificates
pymysql -> python[version='>=2.7,<2.8.0a0'] -> ca-certificates

Package vs2008_runtime conflicts for:
pymysql -> python[version='>=2.7,<2.8.0a0'] -> vs2008_runtime
mysql-connector-c -> vc=9 -> vs2008_runtime[version='>=9.0.30729.1,<10.0a0']
mysql-python -> python[version='>=2.7,<2.8.0a0'] -> vs2008_runtime[version='>=9.0.30729.1,<10.0a0']

Package setuptools conflicts for:
mysql-connector-python -> protobuf[version='>=3.0.0'] -> setuptools
python=3.8 -> pip -> setuptools

Package mysql-connector-c conflicts for:
mysql-connector-python -> mysql-connector-c[version='>=6.1.11,<6.1.12.0a0']
mysql-python -> mysql-connector-c[version='>=6.1.11,<6.1.12.0a0']

【问题讨论】:

  • 请添加导致此错误的命令。
  • Anaconda 导航器截图。 i.stack.imgur.com/NeXKV.jpg 我在搜索选项中输入了 MYSQL,我已经检查了所有的复选框,点击了安装按钮。然后我得到了错误。
  • 看来你需要做更多关于通过 Python 与 mysql 接口的研究。首先弄清楚你实际需要哪些包,而不是尝试安装包名中包含“mysql”的每个包。

标签: python mysql anaconda conda


【解决方案1】:

mysql-python 仅适用于 Python 2.7,您不需要它和 mysql-connector-python。只需安装后者。

【讨论】:

    猜你喜欢
    • 2020-07-15
    • 1970-01-01
    • 2020-01-03
    • 1970-01-01
    • 1970-01-01
    • 2019-04-16
    • 2019-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多