phi-grib / flame

Modeling framework for eTRANSAFE project
GNU General Public License v3.0
12 stars 10 forks source link

issue with pip when creating flame env #139

Closed nbosc closed 4 years ago

nbosc commented 5 years ago

So now, when I try to create the flame env, I get this long error message:

C02XJ285JGH6:flame nbosc$ conda env create -f environment.yml
Collecting package metadata: done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
  current version: 4.6.7
  latest version: 4.6.14

Please update conda by running

    $ conda update -n base -c defaults conda

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

CondaEnvException: Pip subcommand failed with
output: Collecting https://github.com/phi-grib/standardiser/archive/master.zip (from -r /Users/nbosc/flame/condaenv.vvwgvpzy.requirements.txt (line 5))
  Downloading https://github.com/phi-grib/standardiser/archive/master.zip
Collecting https://github.com/josecarlosgomezt/nonconformist/archive/master.zip (from -r /Users/nbosc/flame/condaenv.vvwgvpzy.requirements.txt (line 6))
  Downloading https://github.com/josecarlosgomezt/nonconformist/archive/master.zip
Collecting psycopg2 (from -r /Users/nbosc/flame/condaenv.vvwgvpzy.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/23/7e/93c325482c328619870b6cd09370f6dbe1148283daca65115cd63642e60f/psycopg2-2.8.2.tar.gz

error: ++ /Users/nbosc/anaconda3/bin/conda shell.posix hook
+ eval 'export CONDA_EXE="/Users/nbosc/anaconda3/bin/conda"
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

__conda_hashr() {
    if [ -n "${ZSH_VERSION:+x}" ]; then
        \rehash
    elif [ -n "${POSH_VERSION:+x}" ]; then
        :  # pass
    else
        \hash -r
    fi
}

__conda_activate() {
    if [ -n "${CONDA_PS1_BACKUP:+x}" ]; then
        # Handle transition from shell activated with conda <= 4.3 to a subsequent activation
        # after conda updated to >= 4.4. See issue #6173.
        PS1="$CONDA_PS1_BACKUP"
        \unset CONDA_PS1_BACKUP
    fi

    \local cmd="$1"
    shift
    \local ask_conda
    ask_conda="$(PS1="$PS1" "$CONDA_EXE" shell.posix "$cmd" "$@")" || \return $?
    \eval "$ask_conda"
    __conda_hashr
}

__conda_reactivate() {
    \local ask_conda
    ask_conda="$(PS1="$PS1" "$CONDA_EXE" shell.posix reactivate)" || \return $?
    \eval "$ask_conda"
    __conda_hashr
}

conda() {
    if [ "$#" -lt 1 ]; then
        "$CONDA_EXE"
    else
        \local cmd="$1"
        shift
        case "$cmd" in
            activate|deactivate)
                __conda_activate "$cmd" "$@"
                ;;
            install|update|upgrade|remove|uninstall)
                "$CONDA_EXE" "$cmd" "$@" && __conda_reactivate
                ;;
            *) "$CONDA_EXE" "$cmd" "$@" ;;
        esac
    fi
}

if [ -z "${CONDA_SHLVL+x}" ]; then
    \export CONDA_SHLVL=0
    PATH="$(dirname "$(dirname "$CONDA_EXE")")/condabin:${PATH:-}"
    \export PATH

    # We'\''re not allowing PS1 to be unbound. It must at least be set.
    # However, we'\''re not exporting it, which can cause problems when starting a second shell
    # via a first shell (i.e. starting zsh from bash).
    if [ -z "${PS1+x}" ]; then
        PS1=
    fi
fi

conda activate base'
++ export CONDA_EXE=/Users/nbosc/anaconda3/bin/conda
++ CONDA_EXE=/Users/nbosc/anaconda3/bin/conda
++ '[' -z x ']'
++ conda activate base
++ '[' 2 -lt 1 ']'
++ local cmd=activate
++ shift
++ case "$cmd" in
++ __conda_activate activate base
++ '[' -n '' ']'
++ local cmd=activate
++ shift
++ local ask_conda
+++ PS1=
+++ /Users/nbosc/anaconda3/bin/conda shell.posix activate base
++ ask_conda='PS1='\''(base) '\''
\export CONDA_DEFAULT_ENV='\''base'\''
\export CONDA_EXE='\''/Users/nbosc/anaconda3/bin/conda'\''
\export CONDA_PREFIX='\''/Users/nbosc/anaconda3'\''
\export CONDA_PROMPT_MODIFIER='\''(base) '\''
\export CONDA_PYTHON_EXE='\''/Users/nbosc/anaconda3/bin/python'\''
\export CONDA_SHLVL='\''1'\''
\export PATH='\''/Users/nbosc/anaconda3/bin:/Users/nbosc/anaconda3/condabin:/Users/nbosc/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/Users/nbosc/Library/TeX/texbin/pdftex:/usr/local/mysql/bin'\'''
++ eval 'PS1='\''(base) '\''
\export CONDA_DEFAULT_ENV='\''base'\''
\export CONDA_EXE='\''/Users/nbosc/anaconda3/bin/conda'\''
\export CONDA_PREFIX='\''/Users/nbosc/anaconda3'\''
\export CONDA_PROMPT_MODIFIER='\''(base) '\''
\export CONDA_PYTHON_EXE='\''/Users/nbosc/anaconda3/bin/python'\''
\export CONDA_SHLVL='\''1'\''
\export PATH='\''/Users/nbosc/anaconda3/bin:/Users/nbosc/anaconda3/condabin:/Users/nbosc/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/Users/nbosc/Library/TeX/texbin/pdftex:/usr/local/mysql/bin'\'''
+++ PS1='(base) '
+++ export CONDA_DEFAULT_ENV=base
+++ CONDA_DEFAULT_ENV=base
+++ export CONDA_EXE=/Users/nbosc/anaconda3/bin/conda
+++ CONDA_EXE=/Users/nbosc/anaconda3/bin/conda
+++ export CONDA_PREFIX=/Users/nbosc/anaconda3
+++ CONDA_PREFIX=/Users/nbosc/anaconda3
+++ export 'CONDA_PROMPT_MODIFIER=(base) '
+++ CONDA_PROMPT_MODIFIER='(base) '
+++ export CONDA_PYTHON_EXE=/Users/nbosc/anaconda3/bin/python
+++ CONDA_PYTHON_EXE=/Users/nbosc/anaconda3/bin/python
+++ export CONDA_SHLVL=1
+++ CONDA_SHLVL=1
+++ export PATH=/Users/nbosc/anaconda3/bin:/Users/nbosc/anaconda3/condabin:/Users/nbosc/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/Users/nbosc/Library/TeX/texbin/pdftex:/usr/local/mysql/bin
+++ PATH=/Users/nbosc/anaconda3/bin:/Users/nbosc/anaconda3/condabin:/Users/nbosc/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/Users/nbosc/Library/TeX/texbin/pdftex:/usr/local/mysql/bin
++ __conda_hashr
++ '[' -n '' ']'
++ '[' -n '' ']'
++ hash -r
+ conda activate /Users/nbosc/anaconda3/envs/flame
+ '[' 2 -lt 1 ']'
+ local cmd=activate
+ shift
+ case "$cmd" in
+ __conda_activate activate /Users/nbosc/anaconda3/envs/flame
+ '[' -n '' ']'
+ local cmd=activate
+ shift
+ local ask_conda
++ PS1='(base) '
++ /Users/nbosc/anaconda3/bin/conda shell.posix activate /Users/nbosc/anaconda3/envs/flame
+ ask_conda='PS1='\''(flame) '\''
\export CONDA_DEFAULT_ENV='\''flame'\''
\export CONDA_PREFIX='\''/Users/nbosc/anaconda3/envs/flame'\''
\export CONDA_PREFIX_1='\''/Users/nbosc/anaconda3'\''
\export CONDA_PROMPT_MODIFIER='\''(flame) '\''
\export CONDA_SHLVL='\''2'\''
\export PATH='\''/Users/nbosc/anaconda3/envs/flame/bin:/Users/nbosc/anaconda3/condabin:/Users/nbosc/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/Users/nbosc/Library/TeX/texbin/pdftex:/usr/local/mysql/bin'\'''
+ eval 'PS1='\''(flame) '\''
\export CONDA_DEFAULT_ENV='\''flame'\''
\export CONDA_PREFIX='\''/Users/nbosc/anaconda3/envs/flame'\''
\export CONDA_PREFIX_1='\''/Users/nbosc/anaconda3'\''
\export CONDA_PROMPT_MODIFIER='\''(flame) '\''
\export CONDA_SHLVL='\''2'\''
\export PATH='\''/Users/nbosc/anaconda3/envs/flame/bin:/Users/nbosc/anaconda3/condabin:/Users/nbosc/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/Users/nbosc/Library/TeX/texbin/pdftex:/usr/local/mysql/bin'\'''
++ PS1='(flame) '
++ export CONDA_DEFAULT_ENV=flame
++ CONDA_DEFAULT_ENV=flame
++ export CONDA_PREFIX=/Users/nbosc/anaconda3/envs/flame
++ CONDA_PREFIX=/Users/nbosc/anaconda3/envs/flame
++ export CONDA_PREFIX_1=/Users/nbosc/anaconda3
++ CONDA_PREFIX_1=/Users/nbosc/anaconda3
++ export 'CONDA_PROMPT_MODIFIER=(flame) '
++ CONDA_PROMPT_MODIFIER='(flame) '
++ export CONDA_SHLVL=2
++ CONDA_SHLVL=2
++ export PATH=/Users/nbosc/anaconda3/envs/flame/bin:/Users/nbosc/anaconda3/condabin:/Users/nbosc/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/Users/nbosc/Library/TeX/texbin/pdftex:/usr/local/mysql/bin
++ PATH=/Users/nbosc/anaconda3/envs/flame/bin:/Users/nbosc/anaconda3/condabin:/Users/nbosc/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/Users/nbosc/Library/TeX/texbin/pdftex:/usr/local/mysql/bin
+ __conda_hashr
+ '[' -n '' ']'
+ '[' -n '' ']'
+ hash -r
+ pip install -r /Users/nbosc/flame/condaenv.vvwgvpzy.requirements.txt
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.

    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).

    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/sq/366j0cvs7pj1xp1jbft5d5nd6wcrt4/T/pip-install-vxmq3y8m/psycopg2/

I have downgraded pip to version 18.1 (I have seen somewhere else someone having a similar issue and that was the fix) but this does not solve the problem.

Running under MacOS Mojave 10.14.4

nbosc commented 5 years ago

Error is now shorter but there is still the issue with pg_config when trying to install psycopg2:

base) C02XJ285JGH6:flame nbosc$ conda env create -f environment.yml
Collecting package metadata: done
Solving environment: done

Downloading and Extracting Packages
pip-19.1.1           | 1.8 MB    | ######################################################################################################### | 100%
zstd-1.4.0           | 652 KB    | ######################################################################################################### | 100%
matplotlib-3.1.0     | 6 KB      | ######################################################################################################### | 100%
lz4-c-1.8.3          | 139 KB    | ######################################################################################################### | 100%
cairo-1.16.0         | 1.3 MB    | ######################################################################################################### | 100%
glib-2.58.3          | 3.1 MB    | ######################################################################################################### | 100%
joblib-0.13.2        | 180 KB    | ######################################################################################################### | 100%
pluggy-0.12.0        | 18 KB     | ######################################################################################################### | 100%
ca-certificates-2019 | 145 KB    | ######################################################################################################### | 100%
cryptography-2.7     | 566 KB    | ######################################################################################################### | 100%
cherrypy-18.1.1      | 572 KB    | ######################################################################################################### | 100%
pixman-0.38.0        | 611 KB    | ######################################################################################################### | 100%
pyyaml-5.1.1         | 166 KB    | ######################################################################################################### | 100%
importlib_metadata-0 | 36 KB     | ######################################################################################################### | 100%
cheroot-6.5.5        | 59 KB     | ######################################################################################################### | 100%
matplotlib-base-3.1. | 6.6 MB    | ######################################################################################################### | 100%
packaging-19.0       | 23 KB     | ######################################################################################################### | 100%
zipp-0.5.1           | 7 KB      | ######################################################################################################### | 100%
libtiff-4.0.10       | 527 KB    | ######################################################################################################### | 100%
scikit-learn-0.21.2  | 5.9 MB    | ######################################################################################################### | 100%
tk-8.6.9             | 3.2 MB    | ######################################################################################################### | 100%
pytest-4.6.3         | 356 KB    | ######################################################################################################### | 100%
rdkit-2019.03.2.0    | 22.2 MB   | ######################################################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Ran pip subprocess with arguments:
['/Users/nbosc/anaconda3/envs/flame/bin/python', '-m', 'pip', 'install', '-U', '-r', '/Users/nbosc/flame/condaenv.4jd7om6b.requirements.txt']
Pip subprocess output:
Collecting https://github.com/phi-grib/standardiser/archive/master.zip (from -r /Users/nbosc/flame/condaenv.4jd7om6b.requirements.txt (line 5))
  Downloading https://github.com/phi-grib/standardiser/archive/master.zip
Collecting https://github.com/josecarlosgomezt/nonconformist/archive/master.zip (from -r /Users/nbosc/flame/condaenv.4jd7om6b.requirements.txt (line 6))
  Downloading https://github.com/josecarlosgomezt/nonconformist/archive/master.zip
Collecting psycopg2 (from -r /Users/nbosc/flame/condaenv.4jd7om6b.requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz (377kB)

Pip subprocess error:
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.

    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).

    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/sq/366j0cvs7pj1xp1jbft5d5nd6wcrt4/T/pip-install-lxmn01sy/psycopg2/

CondaEnvException: Pip failed
nbosc commented 5 years ago

Installed postgresql (brew install postgresql) and problem solved

manuelpastor commented 4 years ago

The problem was fixed after we relaxed the versions defined in the conda environment and allow conda to select suitable versions for Mac platforms