File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -94,16 +94,22 @@ else:
94
94
EOF
95
95
96
96
if [ $? -eq 1 ]; then # Older version installed, or not installed at all
97
- echo " First time run paddle, need to install some python dependencies."
98
- BASEDIR=$( dirname " $0 " )
99
- pip install ${BASEDIR} /../opt/paddle/share/wheels/* -@PADDLE_VERSION@-* .whl
100
- if [ $? -ne 0 ]; then
101
- echo " pip install wheels failed. "
102
- echo " Please use 'sudo paddle' at the first time you use PaddlePaddle"
103
- echo " PaddlePaddle will install some python dependencies automatically."
104
- exit 1
105
- fi
106
- echo " Python dependencies are installed."
97
+ echo " First time run paddle, need to install some python dependencies."
98
+ # setuptools normalizes package version, so we need to use normalized
99
+ # package version for paddle python package
100
+ PYTHON_PADDLE_VERSION=$( python -c ' import packaging
101
+ import setuptools
102
+ print str(packaging.version.Version("@PADDLE_VERSION@"))
103
+ ' 2> /dev/null)
104
+ BASEDIR=$( dirname " $0 " )
105
+ pip install ${BASEDIR} /../opt/paddle/share/wheels/* -${PYTHON_PADDLE_VERSION} -* .whl
106
+ if [ $? -ne 0 ]; then
107
+ echo " pip install wheels failed. "
108
+ echo " Please use 'sudo paddle' at the first time you use PaddlePaddle"
109
+ echo " PaddlePaddle will install some python dependencies automatically."
110
+ exit 1
111
+ fi
112
+ echo " Python dependencies are installed."
107
113
fi
108
114
109
115
case " $1 " in
You can’t perform that action at this time.
0 commit comments