Skip to content

Commit 51cde19

Browse files
author
Roman
committed
improve script (add venv)
1 parent 9297101 commit 51cde19

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

scripts/install.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ cd "/usr" || exit 1
7373

7474
linux_install_pre() {
7575
sudo apt-get update
76-
sudo apt-get install --no-install-recommends --no-install-suggests -y apt-utils curl git cmake build-essential
76+
sudo apt-get install --no-install-recommends --no-install-suggests -y apt-utils curl git cmake build-essential python3-dev python3-venv
7777
exit_on_error $?
7878
}
7979

@@ -103,6 +103,11 @@ linux_install_bittensor() {
103103
ohai "Cloning bittensor@master into ~/.bittensor/bittensor"
104104
mkdir -p ~/.bittensor/bittensor
105105
git clone https://github.com/opentensor/bittensor.git ~/.bittensor/bittensor/ 2> /dev/null || (cd ~/.bittensor/bittensor/ ; git fetch origin master ; git checkout master ; git pull --ff-only ; git reset --hard ; git clean -xdf)
106+
107+
ohai "Creating Python virtual environment"
108+
python3 -m venv ~/.bittensor/venv
109+
source ~/.bittensor/venv/bin/activate
110+
106111
ohai "Installing bittensor"
107112
$python -m pip install -e ~/.bittensor/bittensor/
108113
$python -m pip install -U bittensor-cli
@@ -166,6 +171,11 @@ mac_update_pip() {
166171
mac_install_bittensor() {
167172
ohai "Cloning bittensor into ~/.bittensor/bittensor"
168173
git clone https://github.com/opentensor/bittensor.git ~/.bittensor/bittensor/ 2> /dev/null || (cd ~/.bittensor/bittensor/ ; git fetch origin master ; git checkout master ; git pull --ff-only ; git reset --hard; git clean -xdf)
174+
175+
ohai "Creating Python virtual environment"
176+
python3 -m venv ~/.bittensor/venv
177+
source ~/.bittensor/venv/bin/activate
178+
169179
ohai "Installing bittensor"
170180
$python -m pip install -e ~/.bittensor/bittensor/
171181
$python -m pip install -U bittensor-cli
@@ -178,7 +188,7 @@ OS="$(uname)"
178188
if [[ "$OS" == "Linux" ]]; then
179189

180190
which -s apt-get
181-
if [[ $? == 0 ]] ; then
191+
if [[ $? != 0 ]] ; then
182192
abort "This linux based install requires apt-get. To run with other distros (centos, arch, etc), you will need to manually install the requirements"
183193
fi
184194
echo """

0 commit comments

Comments
 (0)