{"id":181014,"date":"2024-03-01T09:58:00","date_gmt":"2024-03-01T08:58:00","guid":{"rendered":"https:\/\/liora.io\/en\/?p=181014"},"modified":"2026-08-09T19:40:58","modified_gmt":"2026-08-09T18:40:58","slug":"project-environment-preparation-essential-steps-for-smooth-workflow","status":"publish","type":"post","link":"https:\/\/liora.io\/en\/project-environment-preparation-essential-steps-for-smooth-workflow","title":{"rendered":"Project Environment Preparation: Essential Steps for Smooth Workflow"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"introduction\">Introduction<\/h2>\n\n\n<p><strong>If you are getting started on a <a href=\"https:\/\/liora.io\/en\/4-blockchain-data-science-projects-to-discover\">Data Science project,<\/a> this article will be of interest to you!<\/strong><\/p>\n\n\n<p>Before starting a <a href=\"https:\/\/liora.io\/en\/mlops-devops-applied-to-machine-learning-projects\">Machine Learning project<\/a>, it&#8217;s crucial to prepare and organise your development environment properly!<\/p>\n\n\n<p>In this article, we&#8217;ll show you how to set up and prepare your environment in several stages.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"a-settings\">a) Settings<\/h3>\n\n\n<p>Before getting started, it&#8217;s important to make a few adjustments to your working environment. This step is an essential prerequisite before tackling the root of the problem.<\/p>\n\n\n<p>The first question is which code support you are going to use: there are several solutions for <a href=\"https:\/\/liora.io\/en\/python-the-most-popular-language\">installing Python.<\/a><\/p>\n\n\n<p>You can use <strong>Anaconda, Spyder or any other suitable IDE<\/strong> (or development environment).<\/p>\n\n\n<p>Generally speaking, we recommend using Anaconda for several reasons:<\/p>\n\n\n<ol class=\"wp-block-list\"><li>Firstly, Anaconda&#8217;s features integrate well into your environment and are very easy to use.<\/li><li>Secondly, the Anaconda Desktop user interface is relatively easy to learn.<\/li><li>Finally, Anaconda has a number of packages and libraries that are essential for carrying out the most basic tasks.<\/li><\/ol>\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table>\n<thead>\n<tr>\n<th><\/th>\n<th>On Windows<\/th>\n<th>On Mac<\/th>\n<th>On Linux<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Python<\/td>\n<td colspan=\"2\">https:\/\/www.python.org\/downloads\/<\/td>\n<td>sudo apt-get install python<\/td>\n<\/tr>\n<tr>\n<td>Spyder<\/td>\n<td colspan=\"2\">https:\/\/docs.spyder-ide.org\/3\/installation.html<\/td>\n<td>sudo apt-get install spyder<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n<center>\n<figcaption>Python and Spyder installation commands<\/figcaption>\n<\/center>\n\n\n<h3 class=\"wp-block-heading\" id=\"b-virtual-environment\">b) Virtual environment<\/h3>\n\n\n<p><a href=\"https:\/\/liora.io\/en\/python-vs-julia-which-is-the-best-language-for-data-science\">Once python has been installed<\/a>, it is important to create a virtual environment.<\/p>\n\n\n<h4 class=\"wp-block-heading\" id=\"what-for\">What for?<\/h4>\n\n\n<p>It is important to ensure that only the packages you are using are installed in your environment. The virtual environment allows the <strong>Python interpreter<\/strong> to integrate installed libraries and scripts in isolation.<\/p>\n\n\n<p><strong>Virtualenv (venv)<\/strong> is one of the most widely used tools for this. In most versions of Anaconda, it is pre-integrated. If not, you will need to download it before creating a new environment in the project folder.<\/p>\n\n\n<h4 class=\"wp-block-heading\" id=\"the-benefits\">The benefits<\/h4>\n\n\n<p>You can create and <strong>change virtual environments<\/strong> as often as you like. Each of them can have different libraries and associated packages.<\/p>\n\n\n<p>You can also create environments in<strong> Anaconda<\/strong> quite easily and import the different packages you need directly by searching and installing them.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"margin-top:32px;margin-bottom:32px\"><img alt=\"Illustration for The benefits\" decoding=\"async\" height=\"950\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2022\/10\/script_13.jpg\" style=\"width:100%;height:auto\" width=\"1605\"\/><\/figure>\n\n\n<h4 class=\"wp-block-heading\" id=\"how-do-we-do-it\">How do we do it?<\/h4>\n\n\n<p>There are specific commands for using, activating and deactivating a virtual environment from the terminal on your machine:<\/p>\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table>\n<thead>\n<tr>\n<th><\/th>\n<th>Windows<\/th>\n<th>Mac OS<\/th>\n<th>Linux<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Creation<\/td>\n<td>$ conda create -n nom_env python=3.6<\/td>\n<td colspan=\"2\">$ mkvirtualenv nom_env<\/td>\n<\/tr>\n<tr>\n<td>Activation<\/td>\n<td>$ conda activate nom_env<\/td>\n<td colspan=\"2\">$ source activate nom_env<\/td>\n<\/tr>\n<tr>\n<td>Deactivation<\/td>\n<td>$ deactivate<\/td>\n<td colspan=\"2\">(nom_env)$ source deactivate<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n<h3 class=\"wp-block-heading\" id=\"c-text-editors\">c) Text editors<\/h3>\n\n\n<p>If you&#8217;re working directly with .<strong>py python files<\/strong> for script import, for example, there are various text editors available, such as <strong>Spyder, VSCode, PyCharm, Eclipse with PyDev, and so on.<\/strong><\/p>\n\n\n<p>We recommend using Spyder or VSCode because they have a built-in Python kernel and a library browser, which makes it easier to check code and manipulate installed modules.<\/p>\n\n\n<p>It is also possible to integrate extensions quite easily, for example for formatting code. There are Black and Flake8 for example.<\/p>\n\n\n<p>If, on the other hand, you only want to use Jupyter Notebook, you can install the following formatting extensions: AutoPep8, isort, Flake8_nb&#8230;<\/p>\n\n\n<div class=\"wp-block-group has-background has-global-padding is-layout-constrained wp-container-core-group-is-layout-7441ce17 wp-block-group-is-layout-constrained\" style=\"border-left-color:#ff5c43;border-left-width:4px;border-radius:12px;background-color:#fff5f2;margin-top:32px;margin-bottom:32px;padding-top:24px;padding-right:28px;padding-bottom:24px;padding-left:28px\">\n\n<p style=\"margin-top:0;margin-bottom:16px;font-size:clamp(14.642px, 0.915rem + ((1vw - 3.2px) * 0.575), 22px);font-style:normal;font-weight:600\">Related articles<\/p>\n\n\n<ul class=\"wp-block-list\" style=\"margin-top:0;margin-bottom:0;padding-left:20px\">\n<li><a href=\"https:\/\/liora.io\/en\/folium-discover-the-open-source-python-library\" rel=\"noopener\" target=\"_blank\">Folium: Discover the open source Python library <\/a><\/li>\n<li><a href=\"https:\/\/liora.io\/en\/matplotlib-master-data-visualization-in-python\" rel=\"noopener\" target=\"_blank\">Matplotlib: Master Data Visualization in Python <\/a><\/li>\n<li><a href=\"https:\/\/liora.io\/en\/python-all-you-need-to-know\" rel=\"noopener\" target=\"_blank\">Python Crash Course: Get started <\/a><\/li>\n<li><a href=\"https:\/\/liora.io\/en\/machine-learning-python-where-to-start\" rel=\"noopener\" target=\"_blank\">Mastering Machine Learning in Python: Data-Driven Success <\/a><\/li>\n<li><a href=\"https:\/\/liora.io\/en\/python-programming-for-beginners-episode-3\" rel=\"noopener\" target=\"_blank\">Python Programming for Beginners ,  Episode 3<\/a><\/li>\n<\/ul>\n\n<\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\" style=\"width:387px;max-width:100%;margin-top:32px;margin-right:auto;margin-bottom:32px;margin-left:auto\"><img alt=\"Illustration for c) Text editors\" decoding=\"async\" height=\"137\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2022\/10\/image2.png\" style=\"width:387px;max-width:100%;height:auto\" width=\"387\"\/><\/figure>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\" style=\"width:256px;max-width:100%;margin-top:32px;margin-right:auto;margin-bottom:32px;margin-left:auto\"><img alt=\"Illustration for c) Text editors\" decoding=\"async\" height=\"256\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2022\/10\/image1.png\" style=\"width:256px;max-width:100%;height:auto\" width=\"256\"\/><\/figure>\n\n\n<h3 class=\"wp-block-heading\" id=\"d-organising-the-file\">d) Organising the file<\/h3>\n\n\n<p>The last step before moving on to the project itself is to organise the various python files linked to the project in the same directory (where you created the virtual environment). You will need to add a requirements.txt file containing all the libraries used for documentation purposes.<\/p>\n\n\n<p>How do I display all the installed packages? By using the freeze command<\/p>\n\n\n<p><strong>display pip freeze<\/strong><\/p>\n\n\n<p>You then need to store all these packages in a file in text format.<\/p>\n\n\n<p><strong>display pip freeze &gt; requirements.txt<\/strong><\/p>\n\n\n<p>Now imagine that you want to take over a colleague&#8217;s project. To be able to run all his code, you need to install the installed packages locally. It couldn&#8217;t be simpler: you can run the following command:<\/p>\n\n\n<p><strong>display pip install -r requirements.txt<\/strong><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n<p>The aim of this article was to help you configure your production environment. You&#8217;ve done it!<\/p>\n\n\n<p>You can now tackle any <a href=\"https:\/\/liora.io\/en\/automl-and-machine-learning-automation-a-threat-to-data-scientists\">Machine Learning project.<\/a><\/p>\n\n\n<p>If you&#8217;d like to know more about the different stages of a Machine Learning project, we&#8217;ll see you in the next article.<\/p>\n\n\n<p>See you soon!<\/p>\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center wp-container-core-buttons-is-layout-5ee10de4\" style=\"margin-top:32px;margin-bottom:32px\"><div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/liora.io\/en\/courses\/data-ai\/machine-learning-engineer\">Discover our courses<\/a><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Introduction If you are getting started on a Data Science project, this article will be of interest to you! Before starting a Machine Learning project, it&#8217;s crucial to prepare and organise your development environment properly! In this article, we&#8217;ll show you how to set up and prepare your environment in several stages. a) Settings Before [&hellip;]<\/p>\n","protected":false},"author":76,"featured_media":173167,"comment_status":"open","ping_status":"open","sticky":false,"template":"elementor_theme","format":"standard","meta":{"_acf_changed":false,"editor_notices":[],"footnotes":""},"categories":[2433],"class_list":["post-181014","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai"],"acf":[],"_links":{"self":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/181014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/users\/76"}],"replies":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/comments?post=181014"}],"version-history":[{"count":4,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/181014\/revisions"}],"predecessor-version":[{"id":211037,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/181014\/revisions\/211037"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media\/173167"}],"wp:attachment":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media?parent=181014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/categories?post=181014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}