---
# System prepended metadata

title: Setting up Python env in Windows

---

# Setting up Python env in Windows
## Install Powershell
1. Open a command prompt.
1. Check if winget is installed by typing winget in the command prompt. If it's not installed, you can download and install it from the Microsoft Store or from the official GitHub page.
1. To install PowerShell, type `winget install Microsoft.PowerShell` in the command prompt and hit Enter.
1. Wait for the installation process to complete.
1. To open PowerShell, type powershell in the command prompt and hit Enter.

## Install Git
1. Open a PowerShell window.
1. To install Git, type `winget install Git.Git` in the command prompt and hit Enter.
1. Wait for the installation process to complete.
1. To check if Git is installed, type `git --version` in the command prompt and hit Enter.
1. If Git is installed, you should see the version number in the output.

## Install [pyenv-win](https://github.com/pyenv-win/pyenv-win)
1. Open a PowerShell window.
1. To install pyenv-win, type:
```bash
Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"
```
3. Reopen PowerShell
4. Run pyenv --version to check if the installation was successful.
5. Run pyenv install -l to check a list of Python versions supported by pyenv-win
6. Run pyenv install 3.11.2 to install the supported version
7. Run pyenv global 3.11.2 to set a Python version as the global version

If you get an error during the installation process, follow these steps:

1. Open PowerShell as an administrator. To do this, click on the Start menu, search for "PowerShell", right-click on "Windows PowerShell" and select "Run as administrator".
1. Check the current execution policy by typing the following command: 
    `Get-ExecutionPolicy`
This will return the current execution policy. If it's set to "Restricted", you won't be able to run any scripts.
1. To change the execution policy to allow scripts to run, type the following command:
`Set-ExecutionPolicy RemoteSigned`
This will allow you to run scripts that are signed by a trusted publisher. Confirm the change by typing "Y" and pressing Enter.
1. Run the command to install pyenv-win again:
```bash
Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1
```
## Install Pipenv
1. Open a PowerShell window.
2. Type: `pip install pipenv`

## Install Billing-Parser
1. Open a PowerShell window.
1. Clone the github repository
`git clone https://github.com/pedrojosep/billing-parser.git`
1. `cd  billing-parser`
1. Type: `pipenv install`
1. Type: `pipenv shell`
1. `python main.py <billing_csv>`