change to setup.sh
If you are using a virtualenv with python3.6, then running the setup.sh script will still return python3.7 = True from executing "which python3.7" then installs python3.7 , if the script makes it to "which python3.6" it will return True also You want to use the python version that is installed in your virtualenv, 3.6 being the case here "which python3" will return python3 which isn't helpful either I've added this method to get the current version of python3 being used by the environment python_v=$(pythonversion=$(python -V 2>&1 | grep -Po '(?<=Python )(.+)') && echo "python"$pythonversion | cut -c1-9) changing the script in this was may eliminate some of the if then else logic but I've left it intact until can be tested further.
This commit is contained in:
parent
dcc86bfa55
commit
49a16d1aad
10
setup.sh
10
setup.sh
@ -3,15 +3,14 @@
|
|||||||
|
|
||||||
# Check which python version is installed
|
# Check which python version is installed
|
||||||
function check_installed_python() {
|
function check_installed_python() {
|
||||||
which python3.7
|
python_v=$(pythonversion=$(python -V 2>&1 | grep -Po '(?<=Python )(.+)') && echo "python"$pythonversion | cut -c1-9)
|
||||||
if [ $? -eq 0 ]; then
|
if [ $python_v == "python3.7" ]; then
|
||||||
echo "using Python 3.7"
|
echo "using Python 3.7"
|
||||||
PYTHON=python3.7
|
PYTHON=python3.7
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
which python3.6
|
if [ $python_v == "python3.6" ]; then
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "using Python 3.6"
|
echo "using Python 3.6"
|
||||||
PYTHON=python3.6
|
PYTHON=python3.6
|
||||||
return
|
return
|
||||||
@ -275,6 +274,9 @@ reset
|
|||||||
--plot|-p)
|
--plot|-p)
|
||||||
plot
|
plot
|
||||||
;;
|
;;
|
||||||
|
--check-installed-python|-t)
|
||||||
|
check_installed_python
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
help
|
help
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user