Update venv.py
Browse files
venv.py
CHANGED
@@ -1,9 +1,13 @@
|
|
1 |
import subprocess, sys, os, time, select, pty, errno
|
|
|
2 |
from IPython import get_ipython
|
3 |
from pathlib import Path
|
4 |
|
5 |
xxx = Path('/kaggle/working')
|
6 |
script = xxx / 'venv.py'
|
|
|
|
|
|
|
7 |
|
8 |
os.chdir(xxx)
|
9 |
sys.path.append(str(xxx))
|
@@ -20,8 +24,6 @@ req_list = [
|
|
20 |
f"curl -Lo /usr/bin/cl https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64",
|
21 |
f"apt-get update",
|
22 |
f"apt -y install lz4 pv aria2",
|
23 |
-
f"pip install -q git+https://github.com/DEX-1101/colablib",
|
24 |
-
f"npm install -g localtunnel",
|
25 |
f"chmod +x /usr/bin/cl"]
|
26 |
|
27 |
for items in req_list:
|
@@ -29,20 +31,18 @@ for items in req_list:
|
|
29 |
|
30 |
def venv_install():
|
31 |
os.chdir('/kaggle')
|
32 |
-
url = 'https://huggingface.co/pantat88/back_up/resolve/main/venv.tar.lz4'
|
33 |
-
fn = Path(url).name
|
34 |
download(url)
|
35 |
|
36 |
extract_venv = f'pv {fn} | lz4 -d | tar xf -'
|
37 |
get_ipython().system(extract_venv)
|
38 |
Path(fn).unlink()
|
39 |
|
40 |
-
vnv = Path('/kaggle/venv')
|
41 |
get_ipython().system(f'rm -rf {vnv / "bin" / "pip*"}')
|
42 |
get_ipython().system(f'rm -rf {vnv / "bin" / "python*"}')
|
43 |
get_ipython().system(f'python -m venv {vnv}')
|
|
|
44 |
|
45 |
venv_install()
|
46 |
os.chdir(xxx)
|
47 |
-
|
48 |
script.unlink()
|
|
|
1 |
import subprocess, sys, os, time, select, pty, errno
|
2 |
+
from IPython.display import clear_output
|
3 |
from IPython import get_ipython
|
4 |
from pathlib import Path
|
5 |
|
6 |
xxx = Path('/kaggle/working')
|
7 |
script = xxx / 'venv.py'
|
8 |
+
vnv = Path('/kaggle/venv')
|
9 |
+
url = 'https://huggingface.co/pantat88/back_up/resolve/main/venv.tar.lz4'
|
10 |
+
fn = Path(url).name
|
11 |
|
12 |
os.chdir(xxx)
|
13 |
sys.path.append(str(xxx))
|
|
|
24 |
f"curl -Lo /usr/bin/cl https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64",
|
25 |
f"apt-get update",
|
26 |
f"apt -y install lz4 pv aria2",
|
|
|
|
|
27 |
f"chmod +x /usr/bin/cl"]
|
28 |
|
29 |
for items in req_list:
|
|
|
31 |
|
32 |
def venv_install():
|
33 |
os.chdir('/kaggle')
|
|
|
|
|
34 |
download(url)
|
35 |
|
36 |
extract_venv = f'pv {fn} | lz4 -d | tar xf -'
|
37 |
get_ipython().system(extract_venv)
|
38 |
Path(fn).unlink()
|
39 |
|
|
|
40 |
get_ipython().system(f'rm -rf {vnv / "bin" / "pip*"}')
|
41 |
get_ipython().system(f'rm -rf {vnv / "bin" / "python*"}')
|
42 |
get_ipython().system(f'python -m venv {vnv}')
|
43 |
+
get_ipython().system(f'{vnv}/bin/python3 -m pip install -q --upgrade pip')
|
44 |
|
45 |
venv_install()
|
46 |
os.chdir(xxx)
|
47 |
+
clear_output()
|
48 |
script.unlink()
|