Awesome!
linux here:
git clone https://gist.github.com/21c05b2bb20e1a20c536c4160d1eaf7b.git
cd 21c05b2bb20e1a20c536c4160d1eaf7b/
python hub-install.py
Traceback (most recent call last):
File "hub-install.py", line 80, in <module>
conda_path=Path(os.environ['CONDA_PREFIX'])
NameError: name 'Path' is not defined
So I added:
from pathlib import Path
and try again:
Traceback (most recent call last):
File "hub-install.py", line 91, in <module>
subprocess.run(cmd.split(),shell=False, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
File "/home/stas/anaconda3/envs/fastai/lib/python3.7/subprocess.py", line 466, in run
with Popen(*popenargs, **kwargs) as process:
File "/home/stas/anaconda3/envs/fastai/lib/python3.7/subprocess.py", line 769, in __init__
restore_signals, start_new_session)
File "/home/stas/anaconda3/envs/fastai/lib/python3.7/subprocess.py", line 1516, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '`prefix=/home/stas/anaconda3/envs/fastai`': '`prefix=/home/stas/anaconda3/envs/fastai`'
So I fixed up the final bit of the script to be:
env = {}
#Call OS Specific Installation Script:
if os_type =='linux' or os_type =='mac':
cmd=f'{loc}/install'
# Check for Conda Based Environment
if 'CONDA_DEFAULT_ENV' in os.environ.keys():
if debug : print('Script Executed inside Conda Environment')
env["prefix"] = os.environ['CONDA_PREFIX']
elif os_type=='windows':
cmd=f'install.bat'
# Installation of hub library
print(f"running: {cmd} (env={env})")
my_env = {**os.environ, **env}
subprocess.run(cmd.split(),shell=False, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env)
and then it works.
The env can’t be passed shell style, subprocess
requires the executable first.
This is tested on linux
The updated code is here: https://gist.github.com/stas00/9045b2b7ad08ff861fd45f2576ccbec0
P.S: Looking forward to contribute more. Can you point me to any low hanging fruit tasks? Thanks.
Perhaps this? Port fastai-nbstripout to jupyter lab