<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/quick-tip-knitr-python-windows-setup-checklist/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://itsalocke.com/quick-tip-knitr-python-windows-setup-checklist/"> R – Locke Data</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div></div>
<p>One of the nifty things about using R is that you can use it for many different purposes and even other languages!</p>
<p>If you want to use Python in your <a target="_blank" rel="nofollow" href="https://yihui.name/knitr/">knitr</a> docs or the newish RStudio R notebook functionality, you might encounter some fiddliness getting all the moving parts running on Windows. This is a quick knitr Python Windows setup checklist to make sure you don’t miss any important steps.</p>
<ol>
<li><strong>Install Python</strong>
<ul>
<li>I like <a target="_blank" rel="nofollow" href="https://www.continuum.io/anaconda-overview">Anaconda</a> as it’s one of the nicest Windows install experiences</li>
<li>Try to install for everyone</li>
</ul>
</li>
<li><strong>Add python to your system’s PATH</strong>
<ul>
<li>Here’s some <a target="_blank" rel="nofollow" href="http://windowsitpro.com/systems-management/how-can-i-add-new-folder-my-system-path">general Windows instructions</a> </li>
<li>Here are <a target="_blank" rel="nofollow" href="https://betanews.com/2015/11/23/windows-10-finally-adds-a-new-path-editor/">Windows 10 instructions</a></li>
</ul>
</li>
<li><strong>Restart RStudio</strong> or open it now
<ul>
<li>The restart is because the PATH would likely have been cached so restarting adds the python executable to your RStudio environment</li>
</ul>
</li>
<li><strong>Create an rmarkdown document</strong> or R Notebook</li>
<li><strong>Use chunks beginning with <code>{python chunkname}</code></strong> to execute some code in Python instead of the usual <code>{r chunkname}</code></li>
</ol>
<figure class="wp-caption"><img sizes="(max-width: 602px) 100vw, 602px" alt="Environment variable editor for PATH in Windows 10" class="wp-image-61967" src="https://i0.wp.com/itsalocke.com/wp-content/uploads/2017/02/SYSTEMVARIABLE.png?resize=456%2C503" data-recalc-dims="1"><br>
<figcaption class="wp-caption-text">Environment variable editor for PATH in Windows 10</figcaption>
</figure>
<div class="twitter-share"><a target="_blank" class="twitter-share-button" rel="nofollow" href="https://twitter.com/intent/tweet?url=http%3A%2F%2Fitsalocke.com%2Fquick-tip-knitr-python-windows-setup-checklist%2F&via=stefflocke&%23038;related=stefflocke%3ASteph">Tweet</a></div>
<p>The post <a target="_blank" rel="nofollow" href="http://itsalocke.com/quick-tip-knitr-python-windows-setup-checklist/">Quick tip: knitr Python Windows setup checklist</a> appeared first on <a target="_blank" rel="nofollow" href="http://itsalocke.com/">Locke Data</a>.</p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://itsalocke.com/quick-tip-knitr-python-windows-setup-checklist/"> R – Locke Data</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/DYwtv_3XukI"></a></div>