Por que o Seaborn não instala no PyCharm ou na linha de comando?

0

Quando tento instalar o Seaborn no PyCharm adicionando o pacote aos meus pacotes disponíveis, recebo um erro dizendo

Non-zero exit code (1)

Ele fornece uma solução proposta que é a seguinte:

Try to run this command (pip install seaborn) from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at '/usr/bin/python2.7'.

Quando eu executo o comando no terminal, recebo o seguinte erro:

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-edImGe/matplotlib

O terminal completo é assim:

calflan@calflan-MacBookPro:~/Projects/CIS3303$ pip install seaborn
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.                                                          
Collecting seaborn
  Downloading seaborn-0.7.1.tar.gz (158kB)
    100% |████████████████████████████████| 159kB 2.1MB/s 
Collecting scipy (from seaborn)
  Downloading scipy-0.18.1.tar.gz (13.1MB)
    100% |████████████████████████████████| 13.1MB 48kB/s 
Collecting matplotlib (from seaborn)
  Using cached matplotlib-1.5.3.tar.gz
    Complete output from command python setup.py egg_info:
    IMPORTANT WARNING:
        pkg-config is not installed.
        matplotlib may not be able to find some of its dependencies
============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [1.5.3]
                python: yes [2.7.12 (default, Jul  1 2016, 15:12:24)  [GCC
                        5.4.0 20160609]]
              platform: yes [linux2]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.11.0]
              dateutil: yes [using dateutil version 2.6.0]
                  pytz: yes [using pytz version 2016.7]
                cycler: yes [cycler was not found. pip will attempt to
                        install it after matplotlib.]
               tornado: yes [tornado was not found. It is required for the
                        WebAgg backend. pip/easy_install may attempt to
                        install it after matplotlib.]
             pyparsing: yes [pyparsing was not found. It is required for
                        mathtext support. pip/easy_install may attempt to
                        install it after matplotlib.]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: no  [The C/C++ header for freetype2 (ft2build.h)
                        could not be found.  You may need to install the
                        development package.]
                   png: yes [version 1.2.54]
                 qhull: yes [pkg-config information for 'qhull' could not be
                        found. Using local copy.]

OPTIONAL SUBPACKAGES
           sample_data: yes [installing]
              toolkits: yes [installing]
                 tests: yes [nose 0.11.1 or later is required to run the
                        matplotlib test suite. Please install it with pip or
                        your preferred tool to run the test suite / mock is
                        required to run the matplotlib test suite. Please
                        install it with pip or your preferred tool to run
                        the test suite]
        toolkits_tests: yes [nose 0.11.1 or later is required to run the
                        matplotlib test suite. Please install it with pip or
                        your preferred tool to run the test suite / mock is
                        required to run the matplotlib test suite. Please
                        install it with pip or your preferred tool to run
                        the test suite]

OPTIONAL BACKEND EXTENSIONS
                macosx: no  [Mac OS-X only]
                qt5agg: no  [PyQt5 not found]
                qt4agg: yes [installing, Qt: 4.8.7, PyQt: 4.8.7; PySide not
                        found]
               gtk3agg: no  [Requires gtk3 development files to be
                        installed.]
             gtk3cairo: no  [Requires gtk3 development files to be
                        installed.]
                gtkagg: no  [The C/C++ header for gtk (gtk/gtk.h) could not
                        be found.  You may need to install the development
                        package.]
                 tkagg: yes [installing; run-time loading from Python Tcl /
                        Tk]
                 wxagg: no  [requires wxPython]
                   gtk: no  [The C/C++ header for gtk (gtk/gtk.h) could not
                        be found.  You may need to install the development
                        package.]
                   agg: yes [installing]
                 cairo: yes [installing, pycairo version 1.8.8]
             windowing: no  [Microsoft Windows only]

OPTIONAL LATEX DEPENDENCIES
                dvipng: no
           ghostscript: yes [version 9.18]
                 latex: no
               pdftops: yes [version 0.41.0]

OPTIONAL PACKAGE DATA
                  dlls: no  [skipping due to configuration]

============================================================================
                        * The following required packages can not be built:
                        * freetype

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-edImGe/matplotlib

No topo deste log, diz o seguinte:

You are using pip version 7.1.0, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

Então, tentei atualizar o pip usando o seguinte comando: pip install --upgrade pip , que produziu mais erros, que são os seguintes:

calflan@calflan-MacBookPro:~/Projects/CIS3303$ pip install --upgrade pip

You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pip
  Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 7.1.0
    Uninstalling pip-7.1.0:
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip-7.1.0-py2.7.egg/pip/basecommand.py", line 223, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip-7.1.0-py2.7.egg/pip/commands/install.py", line 299, in run
    root=options.root_path,
  File "/usr/local/lib/python2.7/dist-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 640, in install
    requirement.uninstall(auto_confirm=True)
  File "/usr/local/lib/python2.7/dist-packages/pip-7.1.0-py2.7.egg/pip/req/req_install.py", line 726, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/usr/local/lib/python2.7/dist-packages/pip-7.1.0-py2.7.egg/pip/req/req_uninstall.py", line 125, in remove
    renames(path, new_path)
  File "/usr/local/lib/python2.7/dist-packages/pip-7.1.0-py2.7.egg/pip/utils/__init__.py", line 314, in renames
    shutil.move(old, new)
  File "/usr/lib/python2.7/shutil.py", line 300, in move
    rmtree(src)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "/usr/lib/python2.7/shutil.py", line 250, in rmtree
    os.remove(fullname)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pip-7.1.0-py2.7.egg/EGG-INFO/requires.txt'

o que estou fazendo de errado e o que devo fazer para instalar o Seaborn?

    
por CJF 09.11.2016 / 17:19

1 resposta

2

O problema aqui é que a versão 'pip' precisa ser atualizada, mas o comando normal de pip install --upgrade pip não funcionará. Isso pode ser resolvido desinstalando 'pip' usando sudo pip uninstall pip .

Quando isso for feito, reinstale o 'pip' usando:

sudo apt-get install python-setuptools python-dev build essential

Seguido por:

sudo easy_install pip

Agora, você reinstalou com sucesso o 'pip' (agora em sua forma atualizada), você pode instalar o 'Seaborn' usando:

pip install seaborn

Fonte: link

Ignorando a etapa final, pois ela não é necessária (instalando o virtualenv)

    
por 09.11.2016 / 19:42