This notebook explains how to setup a working environment by using virtual environment (venv).
I suggest using .exe installer.
You can install multiple different versions of python in the same computer. In order to get the list of python versions installed in your computer run below command:
PS C:\Users\user_name> py --list
Installed Pythons found by C:\Windows\py.exe Launcher for Windows
-3.8-64 *
-3.6-64Upgrade pip:
python -m pip install --upgrade pipThis one is needed to isolate the requirements of a project from the rest of Python installation and packages.
pip install virtualenv
virtualenv --version- Create the working folder
- Install virtualenv
- Activate virtual environment
PS C:\Users\user_name> cd .\Desktop\
PS C:\Users\user_name\Desktop> mkdir udacity-data-analyst
PS C:\Users\user_name> cd .\udacity-data-analyst
PS C:\Users\user_name\Desktop\udacity-data-analyst> py -3.6 -m pip install virtualenv
PS C:\Users\user_name\Desktop\udacity-data-analyst> py -3.6 -m virtualenv .venv36
PS C:\Users\user_name\Desktop\udacity-data-analyst> .\.venv36\Scripts\activate.ps1Now the prompt will start as (.venv36). You can verify the python version by typing python --version.
Open PowerShell in your project folder and create virtualenv:
python -m venv ./.venvBefore activating the venv, you need to give permission to PowerShell scripts. Run PowerShell as administrator and execute the following command.
set-executionpolicy remotesignedActivate the venv and upgrade pip:
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pipTo deactivate the venv, type the following:
deactivateNow that we have setup the virtual environment, we can start to install packages.
- Install jupyter
- Install IPython kernel (already comes with jupyter I think)
- Install the visual environment
- List the installed virtual environments
(.venv36) PS C:\Users\user_name\Desktop\udacity-data-analyst> python -m pip install jupyter
(.venv36) PS C:\Users\user_name\Desktop\udacity-data-analyst> python -m pip install ipykernel
(.venv36) PS C:\Users\user_name\Desktop\udacity-data-analyst> python -m ipykernel install --name "data-analyst-name" --display-name "data-analyst-display-name"
Installed kernelspec data-analyst-name in C:\ProgramData\jupyter\kernels\data-analyst-name
(.venv36) PS C:\Users\user_name\Desktop\udacity-data-analyst> jupyter kernelspec listIn order to uninstall a virtual environment from the kernels in Jupyter Notebook, use the command jupyter kernelspec uninstall data-analyst-display-name.
The required packages for RL development is listed below. Make sure that your virtual environment is activated before installing these packages. Otherwise they will be installed to the system instead of your envrionment only.
pip install torch==1.10.1+cu113 torchvision==0.11.2+cu113 torchaudio===0.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
pip install gym
pip install stable-baselines3[extra]
pip install fmpy[complete]
pip install mysql-connector-python- VSCode -> Download the setup file from official page. After VSCode installation, add Python extension from marketplace.
- Install Visual Studio Community edition. This one is needed for C/C++ libraries required by FMU simulations. -> Download
- From the Visual Studio Installer, select Desktop development with C++ in the Workloads tab and make sure the following options are also selected:
- MSVC v143
- Windows 10 SDK (latest)
- C++ profiling tools
- C++ CMake tools for Windows
Install Git for Windows. After installation, there are some steps to go through in order to complete the setup. Download for Windows
git config --global user.name "serhat-akbas"
git config --global user.email serhatakbas89@gmail.com
git config --global core.editor "code --wait"
git config --global color.ui auto
git config --list
git config --list --globalYou also need to configure SSH in order to communicate with GitHub (pull, push etc. commands directly from terminal). Open git bash and type the following:
ssh-keygen -t ed25519 -C "serhatakbas89@gmail.com"
ssh-add ~/.ssh/id_ed25519
clip < ~/.ssh/id_ed25519.pubGo to GitHub and click on "New SSH Key" in settings (SSH and GPG keys). Paste the copied key into the field. For more information, refer to GitHub docs on SSH.
git init
git remote add origin git@github.com:serhat-akbas/udacity-data-analyst.git
git remote -v
git pull origin main
Install WSL (Ubuntu). This is needed for Docker on Windows.
wsl --installThis command installs the latest WSL Linux kernel version onto your machine. Ubuntu is the default distribution of Linux. For the complete documentation, visit official page.
Install Docker Desktop on Windows. Official page.
Build and run the image:
docker build -t project-ai-docker-image -f ./Dockerfile .Run the image:
docker run -it --rm --gpus all project-ai-docker-image bash