{"id":2122,"date":"2024-06-17T15:42:53","date_gmt":"2024-06-17T13:42:53","guid":{"rendered":"https:\/\/robermb.com\/blog\/?p=2122"},"modified":"2024-06-17T15:42:53","modified_gmt":"2024-06-17T13:42:53","slug":"setting-up-your-environment-on-macos-python-3-11-ansible-and-visual-studio-code","status":"publish","type":"post","link":"https:\/\/robermb.com\/blog\/geeks\/setting-up-your-environment-on-macos-python-3-11-ansible-and-visual-studio-code\/","title":{"rendered":"Setting Up Your Environment on macOS: Python 3.11, Ansible, and Visual Studio Code"},"content":{"rendered":"\n<p>When working on macOS, it&#8217;s essential to configure your PATH variable correctly to ensure smooth development workflows. Here\u2019s a guide to set up the PATH for Python 3.11, Ansible, and Visual Studio Code.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1: Setting the PATH for Python 3.11<\/h4>\n\n\n\n<p>To <strong>ensure<\/strong> that <strong>your<\/strong> <strong>terminal<\/strong> <strong>uses<\/strong> <strong>Python<\/strong> <strong>3.11 by default<\/strong>, you need to update your PATH variable. Follow these steps:<\/p>\n\n\n\n<ul>\n<li>Open the Terminal.<\/li>\n\n\n\n<li>Edit your <code>.bash_profile<\/code> or <code>.zshrc<\/code> file (depending on your shell). You can use <code>nano<\/code> or <code>vim<\/code>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$ vi ~\/.bash_profile<\/code><\/pre>\n\n\n\n<ul>\n<li>Add the following lines to the file:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># Setting PATH for Python 3.11\n# The original version is saved in .bash_profile.pysave\nPATH=\"\/Library\/Frameworks\/Python.framework\/Versions\/3.11\/bin:${PATH}\"\nexport PATH<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: Setting the PATH for Ansible<\/h4>\n\n\n\n<p>Next, you&#8217;ll want to set the PATH to <strong>include<\/strong> the <strong>directory<\/strong> where <strong>Ansible<\/strong> is installed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Setting PATH for Ansible\nPATH=\"\/Users\/robermb\/Library\/Python\/3.11\/bin:${PATH}\"\nexport PATH<\/code><\/pre>\n\n\n\n<p><span style=\"text-decoration: underline;\"><em>Note<\/em><\/span>: Replace &#8220;robermb&#8221; with your username.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: Adding Visual Studio Code to PATH<\/h4>\n\n\n\n<p>To <strong>open Visual Studio Code<\/strong> from the terminal <strong>using the <code>code<\/code> command<\/strong>, you need to add its binary to your PATH:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Add Visual Studio Code (code)\nPATH=\"\/Users\/robermb\/Applications\/Visual Studio Code.app\/Contents\/Resources\/app\/bin:${PATH}\"\nexport PATH<\/code><\/pre>\n\n\n\n<ul>\n<li>Save the file and exit the editor.<\/li>\n\n\n\n<li>Reload your profile:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$ source ~\/.bash_profile<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Final Check<\/h4>\n\n\n\n<p>After updating and reloading your profile, you can check if the PATH is set correctly by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ echo $PATH<\/code><\/pre>\n\n\n\n<p>You should see the paths you added listed at the beginning of the output.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working on macOS, it&#8217;s essential to configure your PATH variable correctly to ensure smooth development workflows. Here\u2019s a guide &hellip; <a href=\"https:\/\/robermb.com\/blog\/geeks\/setting-up-your-environment-on-macos-python-3-11-ansible-and-visual-studio-code\/\" class=\"more-link\">More <span class=\"screen-reader-text\">Setting Up Your Environment on macOS: Python 3.11, Ansible, and Visual Studio Code<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,5],"tags":[138,36],"_links":{"self":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts\/2122"}],"collection":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/comments?post=2122"}],"version-history":[{"count":3,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts\/2122\/revisions"}],"predecessor-version":[{"id":2126,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts\/2122\/revisions\/2126"}],"wp:attachment":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/media?parent=2122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/categories?post=2122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/tags?post=2122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}