title: How to fix "Distutils was imported before Setuptools" when opening a .ipynb file?
body: <p>If I try to open my Rscript.ipynb file via Windows Explorer I get the following warning and my file does not open.</p>
  <blockquote>
  <p>c:\Users\kirst\anaconda3\lib\site-packages\setuptools\distutils_patch.py:25 UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable errors. Please use setuptools 'objects directly or at least import setuptools first.</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/dIYo2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dIYo2.png" alt="Warning" /></a></p>
  <p>If I first open the Jupyter Notebook using a shortcut with the following target</p>
  <pre><code>C:\Users\kirst\anaconda3\python.exe C:\Users\kirst\anaconda3\cwp.py C:\Users\kirst\anaconda3\envs\R C:\Users\kirst\anaconda3\envs\R\python.exe C:\Users\kirst\anaconda3\envs\R\Scripts\jupyter-notebook-script.py &quot;%USERPROFILE%/&quot;
  </code></pre>
  <p>and then open the notebook by browsing to it, I don't have problems.</p>
  <p>How do I set up to be able to open the file from explorer?</p>