From cebc13a37c73d88bf917d01b8d8667c69c7ae825 Mon Sep 17 00:00:00 2001 From: Helin Wang Date: Tue, 21 Mar 2017 17:40:12 -0700 Subject: [PATCH] fix paddle pip install package version --- paddle/scripts/submit_local.sh.in | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/paddle/scripts/submit_local.sh.in b/paddle/scripts/submit_local.sh.in index f29d32f0d9..5a45df4072 100644 --- a/paddle/scripts/submit_local.sh.in +++ b/paddle/scripts/submit_local.sh.in @@ -94,16 +94,22 @@ else: EOF if [ $? -eq 1 ]; then # Older version installed, or not installed at all - echo "First time run paddle, need to install some python dependencies." - BASEDIR=$(dirname "$0") - pip install ${BASEDIR}/../opt/paddle/share/wheels/*-@PADDLE_VERSION@-*.whl - if [ $? -ne 0 ]; then - echo "pip install wheels failed. " - echo "Please use 'sudo paddle' at the first time you use PaddlePaddle" - echo "PaddlePaddle will install some python dependencies automatically." - exit 1 - fi - echo "Python dependencies are installed." + echo "First time run paddle, need to install some python dependencies." + # setuptools normalizes package version, so we need to use normalized + # package version for paddle python package + PYTHON_PADDLE_VERSION=$(python -c 'import packaging +import setuptools +print str(packaging.version.Version("@PADDLE_VERSION@")) +' 2>/dev/null) + BASEDIR=$(dirname "$0") + pip install ${BASEDIR}/../opt/paddle/share/wheels/*-${PYTHON_PADDLE_VERSION}-*.whl + if [ $? -ne 0 ]; then + echo "pip install wheels failed. " + echo "Please use 'sudo paddle' at the first time you use PaddlePaddle" + echo "PaddlePaddle will install some python dependencies automatically." + exit 1 + fi + echo "Python dependencies are installed." fi case "$1" in -- GitLab