<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aditya</title>
    <description>The latest articles on DEV Community by Aditya (@aditya005).</description>
    <link>https://dev.to/aditya005</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F214057%2F087f2bca-dcf3-4acc-8b06-f1cf4b0b7a57.jpg</url>
      <title>DEV Community: Aditya</title>
      <link>https://dev.to/aditya005</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aditya005"/>
    <language>en</language>
    <item>
      <title># Right way to do a Python clean install on Mac</title>
      <dc:creator>Aditya</dc:creator>
      <pubDate>Wed, 18 Nov 2020 06:28:28 +0000</pubDate>
      <link>https://dev.to/aditya005/right-way-to-uninstall-clean-python-on-a-mac-4jfo</link>
      <guid>https://dev.to/aditya005/right-way-to-uninstall-clean-python-on-a-mac-4jfo</guid>
      <description>&lt;p&gt;We all have been there trying to figure out the root cause of failure of your scripts, we finally decide to get ride of python once and for all (not really ;))&lt;/p&gt;

&lt;p&gt;This is my opinionated post on how to clean python completely from your system and then do a fresh install&lt;/p&gt;




&lt;h1&gt;
  
  
  Use Homebrew to do the heavy lifting
&lt;/h1&gt;

&lt;p&gt;check to see if &lt;code&gt;homebrew&lt;/code&gt; is installed on your system. more info on its website -&amp;gt; &lt;a href="https://brew.sh/"&gt;https://brew.sh/&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ brew --version
Homebrew 2.5.11
Homebrew/homebrew-core (git revision d4069; last commit 2020-11-18)
Homebrew/homebrew-cask (git revision 0374c82; last commit 2020-11-18)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you don't see the above, lets install &lt;code&gt;homebrew&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you should be able to run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ brew --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Clean up existing Python installations
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; please dont remove the existing python 2.7 which comes along with your mac, there might be apps using this !&lt;/p&gt;

&lt;p&gt;so the default installation of python exists at &lt;code&gt;/usr/bin/python&lt;/code&gt;, lets keep it as is&lt;br&gt;
However, the python installations located in &lt;code&gt;/usr/local/bin&lt;/code&gt; are often symbolic links and can be deleted.&lt;/p&gt;

&lt;p&gt;List all those by running&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ls -l /usr/local/bin/ | grep python*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now see a list of links which are most likely installed in this path -&amp;gt; &lt;code&gt;../../../Library/Frameworks/Python.framework&lt;/code&gt;. If Python were to be installed by &lt;code&gt;Homebrew&lt;/code&gt;, it would be installed in the path -&amp;gt; &lt;code&gt;/Cellar/python@...&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Clean up all python links&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo rm /usr/local/bin/python*
$ sudo rm /usr/local/bin/pip*
$ sudo rm /usr/local/bin/easy*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove versions of python install in the Framework path&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo rm -Rf /Library/Frameworks/Python.framework/Versions/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Environment setup
&lt;/h1&gt;

&lt;p&gt;open &lt;code&gt;~/.bashrc&lt;/code&gt; and &lt;code&gt;~/.bash_profile&lt;/code&gt; and clean up all the references to python Framework path and only have&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export PATH='/usr/local/bin:/usr/local/sbin:/usr/bin:$PATH'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Install Python using brew
&lt;/h1&gt;

&lt;p&gt;Using brew install python&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ brew install python3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: as of Nov 17, 2020: the above command will install &lt;a href="mailto:python@3.9"&gt;python@3.9&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To always keep the python updated using brew&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ brew upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hope this helps keep a clean and updated python version&lt;/p&gt;

&lt;p&gt;🍻&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title># Updating a forked Repo with Origin</title>
      <dc:creator>Aditya</dc:creator>
      <pubDate>Fri, 27 Dec 2019 09:04:37 +0000</pubDate>
      <link>https://dev.to/aditya005/updating-a-forked-repo-with-origin-e62</link>
      <guid>https://dev.to/aditya005/updating-a-forked-repo-with-origin-e62</guid>
      <description>&lt;p&gt;You are looking to contribute to an awesome project on GitHub and you finally find it and fork the repo. a few weeks later you worked on the forked repo but are afraid the fork is way behind the original repo. how would you keep it up to date? here is how&lt;/p&gt;

&lt;p&gt;Below are the steps to always keep the forked repo up to date with its original repo&lt;/p&gt;

&lt;p&gt;1.Add the remote/original repo and lets call it upstream&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git remote add upstream https://github.com/original-repo/repo-name.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Fetch all branches from remote upstream&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git fetch upstream
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Use git rebase to re-write your master with upstream’s master. Note: rebase will fail, if you have uncommitted changes in your forked master&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git rebase upstream/master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Push your updates to master using force&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git push origin master --force
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>github</category>
      <category>coding</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
