Skip to content

Commit

Permalink
Merge pull request #11 from ruomengh/update-env
Browse files Browse the repository at this point in the history
Update setupenv.sh
  • Loading branch information
intelzhongjie authored Mar 1, 2024
2 parents 50b8a45 + 956eff6 commit 8fddcdc
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions setupenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@

CURR_DIR=$(pwd)

# setup PYTHONPATH
python3 -m pip install pip -U
python3 -m pip install "cctrusted_base @ git+https://github.com/cc-api/cc-trusted-api.git#subdirectory=common/python"
export PYTHONPATH=$PYTHONPATH:$CURR_DIR/src/python
# setup virtualenv and PYTHONPATH
apt-get install -y python3-virtualenv

if [[ ! -d ${CURR_DIR}/venv ]]; then
python3 -m virtualenv -p python3 ${CURR_DIR}/venv
source ${CURR_DIR}/venv/bin/activate
python3 -m pip install "cctrusted_base @ git+https://github.com/cc-api/cc-trusted-api.git#subdirectory=common/python"
python3 -m pip install -r $CURR_DIR/src/python/requirements.txt
export PYTHONPATH=$PYTHONPATH:$CURR_DIR/src/python
if [ ! $? -eq 0 ]; then
echo "Failed to install python PIP packages, please check your proxy (https_proxy) or setup PyPi mirror."
deactivate
rm ${CURR_DIR}/venv -fr
return 1
fi
else
source ${CURR_DIR}/venv/bin/activate
fi

0 comments on commit 8fddcdc

Please sign in to comment.