-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#41): add first version of the install scripts for windows.
- Loading branch information
Pablo Vasconez
committed
Nov 21, 2023
1 parent
5fc3a75
commit 0003eec
Showing
10 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@echo off | ||
setlocal enableDelayedExpansion | ||
|
||
Rem Parse input variables | ||
set python_env_dir=%1 | ||
Rem C:\cems-notebooks\plxcontroller | ||
echo python_env_dir is %python_env_dir% and no more. | ||
|
||
Rem Create dir to install the python env dir (if it doesn't exist) | ||
mkdir %python_env_dir% | ||
cd %python_env_dir% | ||
python -m venv %python_env_dir% | ||
call %python_env_dir%/Scripts/activate.bat | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@echo off | ||
setlocal enableDelayedExpansion | ||
|
||
Rem 1. Download and install python | ||
call install_python 3.9.13 C:\cems-python | ||
|
||
Rem 2. Install jupyter lab | ||
call install_jupyterlab | ||
|
||
Rem 3. Set-up notebook directory | ||
call setup_notebook_dir C:\cems-notebooks\plxcontroller | ||
|
||
Rem 4. Create python environment | ||
call create_python_env C:\cems-notebooks\plxcontroller\.env | ||
|
||
Rem 5. Register python environment in ipykernel | ||
call register_env_ipykernel C:\cems-notebooks\plxcontroller\.env "plxcontroller-env" | ||
|
||
Rem 6. Install plxcontroller | ||
call install_plxcontroller C:\cems-notebooks\plxcontroller\.env | ||
|
||
Rem 7. Update plxcontroller (so that the sample notebooks are downloaded) | ||
cd C:\cems-notebooks\plxcontroller | ||
call update_plxcontroller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@echo off | ||
setlocal enableDelayedExpansion | ||
|
||
Rem 1. Download and install python | ||
Rem call install_python 3.9.13 C:\cems-python | ||
|
||
Rem 2. Install jupyter lab | ||
Rem call install_jupyterlab | ||
|
||
Rem 3. Set-up notebook directory | ||
call setup_notebook_dir C:\cems-notebooks\plxcontroller | ||
|
||
Rem 4. Create python environment | ||
call create_python_env C:\cems-notebooks\plxcontroller\.env | ||
|
||
Rem 5. Register python environment in ipykernel | ||
call register_env_ipykernel C:\cems-notebooks\plxcontroller\.env "plxcontroller-env" | ||
|
||
Rem 6. Install plxcontroller | ||
call install_plxcontroller C:\cems-notebooks\plxcontroller\.env | ||
|
||
Rem 7. Update plxcontroller (so that the sample notebooks are downloaded) | ||
cd C:\cems-notebooks\plxcontroller | ||
call update_plxcontroller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@echo off | ||
setlocal enableDelayedExpansion | ||
|
||
Rem This script assumes that you have python installed and it will use the default python | ||
Rem installation | ||
pip install jupyterlab | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@echo off | ||
setlocal enableDelayedExpansion | ||
|
||
Rem This script assumes that you have python installed and it will use the default python | ||
Rem Parse input variables | ||
set python_env_dir=%1 | ||
Rem C:\cems-notebooks\plxcontroller\.env | ||
echo python_env_dir is %python_env_dir% and no more. | ||
|
||
Rem Install ipykernel and register virtual environment | ||
call %python_env_dir%\Scripts\activate.bat | ||
python -m pip install --upgrade pip setuptools | ||
pip install plxcontroller | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@echo off | ||
setlocal enableDelayedExpansion | ||
|
||
Rem Check which python version is available | ||
Rem https://www.python.org/ftp/python/ # | ||
Rem For Windows it should there should be file ending with amd64.exe, e.g.: | ||
Rem https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe | ||
|
||
Rem Parse input variables | ||
set python_version=%1 | ||
Rem recommended: 3.9.13 | ||
echo python_version is %python_version% and no more. | ||
|
||
set python_installation_dir=%2 | ||
Rem C:\cems-python | ||
echo python_installation_dir is %python_installation_dir% and no more. | ||
|
||
Rem Download python | ||
curl https://www.python.org/ftp/python/%python_version%/python-%python_version%-amd64.exe -O | ||
|
||
Rem Install python | ||
mkdir %python_installation_dir%\python-%python_version% | ||
python-%python_version%-amd64.exe TargetDir=%python_installation_dir%\python-%python_version% PrependPath=1 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@echo off | ||
setlocal enableDelayedExpansion | ||
|
||
Rem Parse input variables | ||
set python_env_dir=%1 | ||
Rem C:\cems-notebooks\plxcontroller\.env | ||
echo python_env_dir is %python_env_dir% and no more. | ||
|
||
set kernel_name=%2 | ||
Rem "plxcontroller-env" | ||
echo kernel_name is %kernel_name% and no more. | ||
|
||
Rem Install ipykernel and register virtual environment | ||
call %python_env_dir%/Scripts/activate.bat | ||
python -m pip install --upgrade pip setuptools | ||
pip install ipykernel | ||
python -m ipykernel install --name %kernel_name% | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@echo off | ||
setlocal enableDelayedExpansion | ||
|
||
Rem Parse input variables | ||
set notebooks_installation_dir=%1 | ||
Rem C:\cems-notebooks\plxcontroller | ||
echo notebooks_installation_dir is %notebooks_installation_dir% and no more. | ||
|
||
Rem Create notebook installation dir and add batch file | ||
mkdir %notebooks_installation_dir% %notebooks_installation_dir%\sample | ||
|
||
Rem Copy sample notebooks (old) | ||
Rem xcopy sample %notebooks_installation_dir%\sample | ||
|
||
Rem Copy batch file "start_jupyter_lab" | ||
copy start_jupyter_lab.bat %notebooks_installation_dir% | ||
copy update_plxcontroller.bat %notebooks_installation_dir% | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@echo off | ||
setlocal enableDelayedExpansion | ||
|
||
set current_dir_path=%~dp0 | ||
|
||
jupyter lab --notebook-dir=%current_dir_path% --preferred-dir %current_dir_path% | ||
|
||
Rem Parse input variables | ||
Rem set notebooks_installation_dir=%1 | ||
Rem C:\cems-notebooks\plxcontroller | ||
Rem echo notebooks_installation_dir is %notebooks_installation_dir% and no more. | ||
|
||
Rem Create notebook installation dir and add batch file | ||
Rem mkdir %notebooks_installation_dir% %notebooks_installation_dir%\sample | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@echo off | ||
setlocal enableDelayedExpansion | ||
|
||
Rem Install ipykernel and register virtual environment | ||
call .env\Scripts\activate.bat | ||
pip install --upgrade plxcontroller | ||
|
||
Rem Download files under the notebooks directory in plxcontroller repo | ||
curl https://raw.githubusercontent.com/cemsbv/plxcontroller/main/notebooks/Plaxis3D_input_controller.ipynb -O | ||
curl https://raw.githubusercontent.com/cemsbv/plxcontroller/main/notebooks/image.png -O | ||
curl https://raw.githubusercontent.com/cemsbv/plxcontroller/main/notebooks/requirements.txt -O | ||
|
||
Rem Save the files under the local sample folder | ||
mkdir sample | ||
move Plaxis3D_input_controller.ipynb sample | ||
move image.png sample | ||
move requirements.txt sample |