forked from luigifreda/pyslam
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyenv-activate.sh
More file actions
executable file
·73 lines (54 loc) · 2.07 KB
/
Copy pathpyenv-activate.sh
File metadata and controls
executable file
·73 lines (54 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash
# Author: Luigi Freda
# This file is part of https://github.com/luigifreda/pyslam
#N.B: this install script allows you to run main_slam.py and all the scripts
SCRIPT_DIR_=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # get script dir
SCRIPT_DIR_=$(readlink -f $SCRIPT_DIR_) # this reads the actual path if a symbolic directory is used
ROOT_DIR="$SCRIPT_DIR_"
SCRIPTS_DIR="$ROOT_DIR/scripts"
# ====================================================
# import the bash utils
. "$ROOT_DIR"/bash_utils.sh
STARTING_DIR=`pwd`
cd "$ROOT_DIR"
# ====================================================
#set -e
# ====================================================
# some useful environment variables to remove unwanted warnings
export TF_CPP_MIN_LOG_LEVEL=3 # 0=all messages are logged (default), 1=INFO, 2=WARNING, 3=ERROR, 4=FATAL
# Ignore *all* warnings coming from NumPy getlimits
export PYTHONWARNINGS="ignore:::numpy.core.getlimits"
# Add pkg_resources deprecation message too
export PYTHONWARNINGS="$PYTHONWARNINGS,ignore:pkg_resources is deprecated"
# Disable MIT-SHM extension for Qt/PyQt multi-threading
# export QT_X11_NO_MITSHM=1
# optional:
# export PYTHONWARNINGS="ignore::UserWarning" # ignore all UserWarning
# export TF_ENABLE_ONEDNN_OPTS=0
# export GLOG_minloglevel=3
# export GLOG_logtostderr=1
# ====================================================
# Check if conda is installed
if command -v conda &> /dev/null; then
CONDA_INSTALLED=true
else
CONDA_INSTALLED=false
fi
# check if pixi was installed
if [ -d "$ROOT_DIR/.pixi" ]; then
PIXI_INSTALLED=true
else
PIXI_INSTALLED=false
fi
if [ "$PIXI_INSTALLED" = true ]; then
print_blue "You need to activate pySLAM environment by using pixi shell"
#pixi shell
elif [ "$CONDA_INSTALLED" = true ]; then
# check that conda is activated
print_blue "Activating pySLAM environment by using conda"
. $SCRIPTS_DIR/pyenv-conda-activate.sh
else
print_blue "Activating pySLAM environment by using venv"
. $SCRIPTS_DIR/pyenv-venv-activate.sh
fi
cd "$STARTING_DIR"