Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple Matplotlib libraries #423

Closed
ernestmartinez opened this issue Mar 14, 2018 · 10 comments
Closed

multiple Matplotlib libraries #423

ernestmartinez opened this issue Mar 14, 2018 · 10 comments
Labels
area/jupyter Issues related to Jupyter priority/p1

Comments

@ernestmartinez
Copy link

ernestmartinez commented Mar 14, 2018

While trying basic plots in jupyter I get
AttributeError: module 'matplotlib.cbook' has no attribute 'popall

google search suggested multiple installed matplotlib libraries to be culprit.

jovyan@jupyter-admin:~$ conda list matplotlib

packages in environment at /opt/conda:

matplotlib 2.1.2
matplotlib 2.0.2 py36_2 conda-forge

jovyan@jupyter-admin:~$ pip list |grep matplotlib
matplotlib (2.1.2)

Trying to uninstall conda libs caused:

jovyan@jupyter-admin:~$ conda uninstall matplotlib
Fetching package metadata
Solving package specifications: .

The following packages will be REMOVED:

matplotlib: 2.0.2-py36_2 conda-forge

Proceed ([y]/n)? y

ERROR conda.core.link:_execute_actions(339): An error occurred while uninstalling package 'conda-forge::matplotlib-2.0.2-py36_2'.
PermissionError(13, 'Permission denied')
Attempting to roll back.

PermissionError(13, 'Permission denied')
Current conda install:

           platform : linux-64
      conda version : 4.3.34
   conda is private : False
  conda-env version : 4.3.34
conda-build version : not installed
     python version : 3.6.3.final.0
   requests version : 2.18.4
   root environment : /opt/conda  (writable)
default environment : /opt/conda
   envs directories : /opt/conda/envs
                      /home/jovyan/.conda/envs
      package cache : /opt/conda/pkgs
                      /home/jovyan/.conda/pkgs
       channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                      https://conda.anaconda.org/conda-forge/noarch
                      https://repo.continuum.io/pkgs/main/linux-64
                      https://repo.continuum.io/pkgs/main/noarch
                      https://repo.continuum.io/pkgs/free/linux-64
                      https://repo.continuum.io/pkgs/free/noarch
                      https://repo.continuum.io/pkgs/r/linux-64
                      https://repo.continuum.io/pkgs/r/noarch
                      https://repo.continuum.io/pkgs/pro/linux-64
                      https://repo.continuum.io/pkgs/pro/noarch
        config file : /opt/conda/.condarc
         netrc file : None
       offline mode : False
         user-agent : conda/4.3.34 requests/2.18.4 CPython/3.6.3 Linux/4.4.0-116-generic debian/stretch/sid glibc/2.23
            UID:GID : 1000:100
@jlewi
Copy link
Contributor

jlewi commented Mar 14, 2018

/cc @ojarjur

@jlewi jlewi added the area/jupyter Issues related to Jupyter label Mar 19, 2018
@willingc
Copy link
Contributor

willingc commented Apr 8, 2018

Looks like you have a Python version mismatch with conda package. Delete the entire conda/Anaconda directory and reinstall.

@ernestmartinez
Copy link
Author

The issue is having conda and pip installed libs for matplotlib, the fix being to pip uninstall matplotlib. Unfortunately I cannot sudo nor become root in order to delete anything as a Jupyterhub user.

@willingc
Copy link
Contributor

willingc commented Apr 9, 2018

@ernestmartinez Are you able to do the following within a notebook cell?

%%bash
python3 -m pip uninstall matplotlib

Or at the command line:

python3 -m pip uninstall matplotlib

@jlewi
Copy link
Contributor

jlewi commented May 8, 2018

@willingc I believe we are using a combination of conda and non-conda packages; I'm guessing because not everything we want is in conda (e.g. TFX and beam). Is this the right thing to do? Is there a better way to handle this.

@jlewi
Copy link
Contributor

jlewi commented May 8, 2018

If I'm understanding comment 1 it looks like conda is installing matplotlib 2.0.2 but there is a newer version 2.1.2 installed as well.

It looks like matplotlib 2.2 is the latest release.

Can we fix this just by uninstalling the conda installed version in our docker images using the command @willingc provided above.

@willingc
Copy link
Contributor

willingc commented May 8, 2018

The best way would be to create an environment.yml file to use with conda where you can conda install and pip install from one file. Example from repo2docker Example from JupyterHub docs - this is the more straightforward example

In general, I would use conda-forge for the channel.

The yaml file will list conda packages and then pip packages. Here's an example from the conda docs: https://conda.io/docs/user-guide/tasks/manage-environments.html#creating-an-environment-file-manually

@willingc
Copy link
Contributor

willingc commented May 8, 2018

@jlewi The conda cheatsheet is helpful too. https://conda.io/docs/user-guide/cheatsheet.html

@pdmack
Copy link
Member

pdmack commented May 31, 2018

Is this still an issue? All I see in the current 1.8 notebook is:

matplotlib                2.2.2                     <pip>

@jlewi
Copy link
Contributor

jlewi commented Jun 5, 2018

Marking this fixed based on @pdmack's comment.

@jlewi jlewi closed this as completed Jun 5, 2018
elenzio9 pushed a commit to arrikto/kubeflow that referenced this issue Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/jupyter Issues related to Jupyter priority/p1
Projects
None yet
Development

No branches or pull requests

4 participants