Skip to content

Commit 8f8b6d8

Browse files
authored
Fix for import requests and import caffe failures (#12813)
Recently virtual environments were introduced in the docker images which was a great contribution to localize errors: #12663. In this fix, link to the caffe is created inside this virtual env instead of adding it to the system path of python. This fix also removes importing request package where not needed. Fixes #12663
1 parent 6b3be49 commit 8f8b6d8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ci/scripts/github_skipped_tests_comment.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
from urllib import error
2525
from xml.etree import ElementTree
2626

27-
import requests
28-
2927
from git_utils import git, GitHubRepo, parse_remote
3028
from cmd_utils import init_log
3129

docker/install/ubuntu_install_caffe.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
set -euxo pipefail
2020

21+
if [ -z "${TVM_VENV+x}" ]; then
22+
echo "ERROR: expect TVM_VENV env var to be set"
23+
exit 2
24+
fi
25+
2126
apt-get update --fix-missing
2227

2328
# # Install dependencies
@@ -60,4 +65,5 @@ cd / && rm -rf /caffe_src
6065

6166
PYCAFFE_ROOT=${CAFFE_HOME}/python
6267
echo "${CAFFE_HOME}/lib" >> /etc/ld.so.conf.d/caffe.conf && ldconfig
63-
ln -s ${PYCAFFE_ROOT}/caffe /usr/local/lib/python3.7/dist-packages/caffe
68+
VENV_SITE_PACKAGE=$(pip3 show numpy | grep "Location:" | cut -d ' ' -f 2)
69+
ln -s ${PYCAFFE_ROOT}/caffe ${VENV_SITE_PACKAGE}/caffe

0 commit comments

Comments
 (0)