[Note] Conflict between matplotlib and zstd

I was addicted to it, so I made a note. However, it is unclear if this method is the best.

environment

phenomenon

--zstd not found --zstd is installed when you install matplotlib with conda

ModuleNotFoundError: No module named 'zstd'

Confirmation work

1. Manually uninstall / install zstd

(hogehoge) C:\test> conda uninstall zstd
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\hoge\Anaconda3\envs\hogehoge

  removed specs:
    - zstd


The following packages will be REMOVED:

  cycler-0.10.0-py37_0
  freetype-2.10.4-hd328e21_0
  kiwisolver-1.3.0-py37hd77b12b_0
  libtiff-4.1.0-h56a325e_1
  lz4-c-1.9.2-hf4a77e7_3
  matplotlib-3.3.2-haa95532_0
  matplotlib-base-3.3.2-py37hba9282a_0
  olefile-0.46-py37_0
  pillow-8.1.0-py37h4fa10fc_0
  tk-8.6.10-he774522_0
  xz-5.2.5-h62dcd97_0
  zstd-1.4.5-h04227a9_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(hogehoge) C:\test> conda install zstd
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\hoge\Anaconda3\envs\hogehoge

  added / updated specs:
    - zstd


The following NEW packages will be INSTALLED:

  lz4-c              pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3
  xz                 pkgs/main/win-64::xz-5.2.5-h62dcd97_0
  zstd               pkgs/main/win-64::zstd-1.4.5-h04227a9_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(hogehoge) C:\test>

--matplotlib not found --Because matplotlib is also uninstalled when zstd is uninstalled --But when you install zstd, matplotlib is not installed

ModuleNotFoundError: No module named 'matplotlib'

2. Install matplotlib in the above state

(hogegohe) C:\test> conda install matplotlib
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\hoge\Anaconda3\envs\hogehoge

  added / updated specs:
    - matplotlib


The following NEW packages will be INSTALLED:

  cycler             pkgs/main/win-64::cycler-0.10.0-py37_0
  freetype           pkgs/main/win-64::freetype-2.10.4-hd328e21_0
  kiwisolver         pkgs/main/win-64::kiwisolver-1.3.0-py37hd77b12b_0
  libtiff            pkgs/main/win-64::libtiff-4.1.0-h56a325e_1
  matplotlib         pkgs/main/win-64::matplotlib-3.3.2-haa95532_0
  matplotlib-base    pkgs/main/win-64::matplotlib-base-3.3.2-py37hba9282a_0
  olefile            pkgs/main/win-64::olefile-0.46-py37_0
  pillow             pkgs/main/win-64::pillow-8.1.0-py37h4fa10fc_0
  tk                 pkgs/main/win-64::tk-8.6.10-he774522_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(hogegohe) C:\test>

--zstd cannot be found --When matplotlib is installed, zstd is not changed (because it is already installed)

ModuleNotFoundError: No module named 'zstd'

Solutions

--Install with pip instead of conda

(hogehoge) C:\test>conda uninstall matplotlib zstd
(abridgement)

(hogehoge) C:\test>pip install matplotlib zstd
Collecting matplotlib
  Using cached matplotlib-3.3.3-cp37-cp37m-win_amd64.whl (8.5 MB)
Requirement already satisfied: cycler>=0.10 in c:\users\mine\anaconda3\envs\r-ccs\lib\site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\mine\anaconda3\envs\r-ccs\lib\site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\mine\anaconda3\envs\r-ccs\lib\site-packages (from matplotlib) (1.3.1)
Requirement already satisfied: numpy>=1.15 in c:\users\mine\anaconda3\envs\r-ccs\lib\site-packages (from matplotlib) (1.19.2)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in c:\users\mine\anaconda3\envs\r-ccs\lib\site-packages (from matplotlib) (2.4.7)
Requirement already satisfied: six in c:\users\mine\anaconda3\envs\r-ccs\lib\site-packages (from cycler>=0.10->matplotlib) (1.15.0)
Collecting pillow>=6.2.0
  Using cached Pillow-8.1.0-cp37-cp37m-win_amd64.whl (2.2 MB)
Collecting zstd
  Using cached zstd-1.4.8.1-cp37-cp37m-win_amd64.whl
Installing collected packages: pillow, zstd, matplotlib
Successfully installed matplotlib-3.3.3 pillow-8.1.0 zstd-1.4.8.1

(hogehoge) C:\test>

Note

--Install cycler and kiwisolver that have been uninstalled together with conda instead of pip --Cannot be found after installing with pip --There are other modules that have been uninstalled, so you may need to install them with conda.

(hogehoge) C:\test>conda install cycler kiwisolver
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\hoge\Anaconda3\envs\hogehoge

  added / updated specs:
    - cycler
    - kiwisolver


The following NEW packages will be INSTALLED:

  cycler             pkgs/main/win-64::cycler-0.10.0-py37_0
  kiwisolver         pkgs/main/win-64::kiwisolver-1.3.0-py37hd77b12b_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(hogehoge) C:\test>

Recommended Posts

[Note] Conflict between matplotlib and zstd
(Note) Difference between gateway and default gateway
Matplotlib Basics / Differences between fig and axes
Between parametric and nonparametric
[Note] PCA and t-SNE
matplotlib this and that
Difference between process and job
Correspondence between pandas and SQL
Conversion between unixtime and datetime
Difference between "categorical_crossentropy" and "sparse_categorical_crossentropy"
Difference between regression and classification
Collaboration between PTVS and Anaconda
matplotlib gallery and color map
Connection between flask and sqlite3
NumPy and matplotlib environment construction
Difference between np.array and np.arange
Difference between MicroPython and CPython
Cooperation between py2exe and setuptools
Boundary between C and Golang
Difference between ps a and ps -a
Difference between return and print-Python