Error importing Seaborn module in Python

后端 未结 15 1330
长情又很酷
长情又很酷 2020-12-31 00:24

I am trying to import seaborn into python (using 2.7) using the following code:

import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
imp         


        
相关标签:
15条回答
  • 2020-12-31 01:07

    If your python version is 2.+, you can type below code to the terminal :

    pip install seaborn
    

    if python version is 3+, type below:

    pip3 install seaborn
    
    0 讨论(0)
  • 2020-12-31 01:07

    I solved the same importing problem reinstalling to seaborn package with

    conda install -c https://conda.anaconda.org/anaconda seaborn

    by typing the command on a Windows command console Afterwards I could then import seaborn successfully when I launched the IPython Notebook via on Anaconda launcher.

    On the other failed way launching the IPython Notebook via Anaconda folder did not work for me.

    0 讨论(0)
  • 2020-12-31 01:07

    It seams that missing dependency of python-dev, install python-dev and then try to install seaborn, if you are using Ubuntu:

    sudo apt-get install python-dev -y
    pip install seaborn
    
    0 讨论(0)
  • 2020-12-31 01:09

    Problem may not be associated with Seaborn but Utils package which may not be installed

    sudo pip uninstall requests

    and reinstalling, it no longer would work at all. Luckily, dnf install python-requests fixed the whole thing...

    Also check for utils package is installed or not

    You can install package using

    sudo pip install utils

    Check this link Python ImportError: cannot import name utils

    0 讨论(0)
  • 2020-12-31 01:10

    I had the same problem and I am using iPython. pip or conda by itself did not work for me but when I use !conda it did work.

    !conda install seaborn
    
    0 讨论(0)
  • 2020-12-31 01:10

    I solved this problem by looking at sys.path (the path for finding modules) while in ipython and noticed that I was in a special environment (because I use conda).

    so i went to my terminal and typed "source activate py27" is my python 2.7 environment. and then "conda update seaborn", restarted my jupyter kernel, and then all was good.

    0 讨论(0)
提交回复
热议问题