<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by John Rufino Macasaet on Medium]]></title>
        <description><![CDATA[Stories by John Rufino Macasaet on Medium]]></description>
        <link>https://medium.com/@macasaetjohn?source=rss-1a414d4d66bb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mgsRB9A-d4VybPA-</url>
            <title>Stories by John Rufino Macasaet on Medium</title>
            <link>https://medium.com/@macasaetjohn?source=rss-1a414d4d66bb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:39:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@macasaetjohn/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Setting Up a Spyder Environment with WSL]]></title>
            <link>https://medium.com/@macasaetjohn/setting-up-a-spyder-environment-with-wsl-bb83716a44f3?source=rss-1a414d4d66bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb83716a44f3</guid>
            <category><![CDATA[spyder]]></category>
            <category><![CDATA[wsl]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[John Rufino Macasaet]]></dc:creator>
            <pubDate>Thu, 21 May 2020 08:19:05 GMT</pubDate>
            <atom:updated>2020-05-21T09:17:30.181Z</atom:updated>
            <content:encoded><![CDATA[<p>In this tutorial, we will be setting up a Python 3 and Spyder environment on the Windows Subsystem for Linux (WSL). While Python and the Spyder IDE is available to Windows, it is advantageous to run it from WSL due to the Linux terminal, easier compiler access and various Linux-exclusive packages, among other things.</p><p>Since WSL only provides a terminal for the Linux subsystem, it is not possible to run GUI (windowed) apps natively without a few tweaks (at least, for <a href="https://www.theverge.com/2020/5/19/21263377/microsoft-windows-10-linux-gui-apps-gpu-acceleration-wsl-features">now</a>). In this guide, we will be using an X11 client on Windows 10 to enable windowed Linux apps with WSL.</p><p>You can also use this tutorial to enable other GUI apps to run on WSL. You can skip the sections on installing Python and Spyder.</p><p><strong>Windows Subsystem for Linux (WSL)</strong></p><p>The Windows Subsystem for Linux provides a compatibility layer to run Linux programs on Windows. There are multiple Linux distributions (paid and free) to choose from such as Ubuntu, Debian, Fedora, CentOS, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wT_jwdZT-4-y1mA7" /><figcaption>A few of the available WSL apps on the Microsoft Store.</figcaption></figure><p><strong>Requirements</strong></p><p>The only requirement to install WSL is 64-bit Windows 10 (version 1607 and later). To check that you meet the requirement for WSL, go to Settings &gt; System &gt; About. After the installation of both WSL and the Python packages, the whole environment will take up around 5.5 GB of storage space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OPhq6W3JxTwXJLH0" /></figure><p><strong>Installing WSL</strong></p><p>For this tutorial we will be installing Ubuntu 18.04 LTS as the Linux distribution of choice.</p><p>1. From search, type “features” and open “Turn Windows Features On or Off”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/0*hu2mETu9ZTdmXTQK" /></figure><p>2. From the list, tick on “Windows Subsystem for Linux” and click ok. Restart the computer when prompted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/0*cT59bKXRd0z9fGyh" /></figure><p>3. Open the Microsoft Store app, and search for “Ubuntu 18.04 LTS”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i0J6PPpa5I2ClQcl" /></figure><p>4. Open the Ubuntu 18.04 LTS app from the start menu to finish the setup. Finish setting up WSL by entering a username and password. Remember these as we will be using them for installing the necessary applications later.</p><p>5. Run the following commands on the terminal after successfully setting up Ubuntu:</p><pre>sudo apt-get update</pre><pre>sudo apt-get upgrade</pre><p>6. For a seamless experience, I suggest turning on the “Use Ctrl+Shift+C/V as Copy/Paste” option. Do this by right clicking on the Ubuntu app title bar, and clicking on Properties. The following prompt will appear:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/0*asApw-GvArIhkU8f" /></figure><p><strong>Installing Python through Miniconda</strong></p><ol><li>First, we will download the installer to our Linux system. Enter:</li></ol><pre>wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh</pre><p>2. Run the installer through this command:</p><pre>bash Miniconda3-latest-Linux-x86_64.sh</pre><p>3. Restart the Ubuntu terminal to effect the changes.<br><em>Note: Every time you open the Ubuntu app, it will always default to use python from Miniconda. If you want to use the python from the system, enter:</em></p><pre>conda deactivate</pre><p>4. Install matplotlib, spyder and scipy from conda. Run the following command:</p><pre>conda install matplotlib spyder scipy</pre><p>5. We will be installing additional packages to make Spyder work. Run the following commands:</p><pre>sudo apt-get install libxcursor-dev</pre><pre>sudo apt-get install alsa</pre><pre>sudo apt install libegl1-mesa libegl1</pre><p>6. After installing the above packages, we still need to perform a few steps to get Spyder (and other GUI apps) to run on our Linux subsystem. Follow the next steps.</p><p><strong>Setting up X11 on Linux and Installing the Client on Windows</strong></p><ol><li>Install the X11 client on Windows 10 by downloading VcXsrv from this link: <a href="https://sourceforge.net/projects/vcxsrv/">https://sourceforge.net/projects/vcxsrv/</a> and running the installer on your system.</li></ol><p>2. After installation, we will be now setting up the X11 environment on Linux. In the terminal, type:</p><pre>nano ~/.bashrc</pre><p>3. Scroll to the bottom part of the file by using the down arrow key. Copy the following text and paste it to the file (Ctrl+Shift+V) or you could just type it, if you prefer:</p><pre>DISPLAY=:0</pre><pre>export DISPLAY</pre><pre>LIBGL_ALWAYS_INDIRECT=1</pre><pre>Export LIBGL_ALWAYS_INDIRECT</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FigG691oYvQXRwNY" /></figure><p>4. After typing the text, press Ctrl-X, then press y and the enter key. This will save the .bashrc file. Restart the Ubuntu terminal to effect the changes. This step is important so you don’t have to export those bash variables everytime.</p><p><strong>Launching Spyder (and enabling GUI apps)</strong></p><ol><li>Everytime you open a GUI app in WSL, you must open the XLaunch app (from VcXsrv). You can launch it from the start menu or desktop.You must run XLaunch (and to the succeeding steps) everytime you restart your computer or close XLaunch.</li><li>Select “Multiple windows” and set the display number to 0. Click Next. For the succeeding options, just leave them default (keep on clicking next). Finally, click on Finish. The app will be running in the background (check the taskbar icon).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/0*60Ok8M2KedybRN7R" /></figure><p>3. We can now launch spyder from WSL. Open a WSL terminal, and run:</p><pre>spyder </pre><p>This will open the Spyder IDE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M7YKiZyOHI6djelFtXyAdA.png" /><figcaption>Spyder launched from the Ubuntu terminal</figcaption></figure><p>Congratulations, you have successfully setup a Python 3 and Spyder environment for use with WSL. If you are still having trouble with running Spyder, you may be missing some additional packages. In this case, you can search for solutions online.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb83716a44f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>