LoginSignup
3
0

More than 3 years have passed since last update.

anacondaでmysql-connector-pythonがインストール出来ない対処

Posted at

状況

pythonを学習するにあたりanacondaを使用しているが、データベースを使用するためにインストールしようとしたが、エラーが出た

% conda install mysql-connector-python
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - mysql-connector-python -> python[version='>=2.7,<2.8.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.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.

詳しくはわからないが、互換性がない?バージョンの指定が必要?などが言われているような気がする。
エラーの内容が詳しくわかる方がいるのなら教えてください。

対処法

conda install -c conda-forge mysql-connector-python
Anacondaはパッケージが少ないため、conda-forgeというチャンネルからinstallした。
pipでもインストール出来そうだが、anacondaとpipを混ぜるのは危険という記事を複数見つけたため、今回は使用しなかった。
(conda > conda-forge > pipの順で探してみるといい気がする。)

一言

conda search mysql-connector-pythonを実行したときにpkgs/main channelにあるよ!的なことがわかったから、これを入力してもインストールできるのかもしれない

コマンド実行時に複数のパッケージのインストールがされると表示されたが、これがmysql-connector-pythonの使用に必須の物なのか疑問

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0