Skip to content

1. Python Development Environment installation: Anaconda, Git, PyCharm

umbertopassanisi edited this page Dec 16, 2018 · 1 revision

Python Development environment for FDMS*

In this document we will describe the different tools, settings and strategy used for the development of FDMS transformation rules using Python 3.

Ths document is written based on the Anaconda Python distribution 5.3, Python versions 3.6 and/or 3.7, Pytest 3.8, PyCharm 2018.2.5 (Community Edition).

The different sections of the document are:

  • Anaconda: Python Distribution.
  • Git: Version Control.
  • PyCharm: Integrated Development Environment (IDE).

1.1 Anaconda

This section will describe the installation and used components of Anaconda for the Python development in the FDMS project.

At the date the latest version of Python 3 available is Python 3.7.

https://www.anaconda.com/download/

anaconda download

anaconda1

anaconda2

anaconda3

anaconda4

anaconda5

Anaconda Prompt

By typing: conda list in the (base) C:> , it will be shown all the packages that have been installed with the Anaconda distribution.

conda list

anaconda prompt

1.2 GitHub: Version Control

At the heart of GitHub is an open source version control system (VCS) called Git. Git is responsible for everything GitHub-related that happens locally on your computer. For Windows, in order to use Git on the command line, you'll need to download and install, Git on your computer using this link:

https://git-scm.com/download/win

git

Setting up GIT

git1

git editor

git editor2

git editor3

git editor4

git editor5

git editor6

git editor7

Working with GitHub

git2

git3

git4

1.3 PyCharm: Integrated Development Environment (IDE)

https://www.jetbrains.com/pycharm/download/#section=windows

The Pycharm version to download is the Community version.

pycharm1

pycharm2

pycharm3

pycharm4

pycharm5

Get the anaconda Prompt running in the PyCharm Terminal.

In PyCharm, File menu, Settings > Tools > Terminal, change the Shell path as following:

cmd.exe "/K" "C:\python\anaconda\Scripts\activate.bat" "C:\python\anaconda"

Here we assume that the directory where anaconda is installed is C:\python\anaconda, otherwise replace accordingly.

pycharm

Close the Terminal and reopen it, you will get the Anaconda Prompt.

pycharm terminal

Start Working with Pycharm! :-)

To Start working with Pycharm, you can open one project from the ECFIN/FDMS repository:

Download Zip the branch Staging and unzip it to a local folder in your PC, lets say to: C:\files\gitrepo

branch

download zip

Then you will get all the files in the directory:

C:\files\gitrepo\FDMS-staging

In PyCharm, then, open the directory that you just created e.g C:\gitrepo\FDMS-staging. Once, it appears in the project window, right-click and select the option 'Open in Terminal'. This will open the terminal of PyCharm in the folder of the project just created. Once there, in order to see the example code, open in PyCharm the file: FDMS-staging\fdms\tests\test_country_calculations

In order to test this code, write:

pytest

in the PyCharm terminal.

If the path of the test_country_calculations file appears in the PyCharm terminal the installation of PyCharm together with Anaconda is succesful!.

pytest test

In the next chapters, we will learn more about the Git repository, working, debugging and pytest(ing) with the python code. The fun just starts!!!

Clone this wiki locally