Configuring Sublime Text 3 for Anaconda: A Guide for Data Scientists

Sublime Text 3 is a popular code editor among data scientists due to its simplicity, speed, and extensibility. However, to fully leverage its capabilities, it’s crucial to configure it correctly with Anaconda, a powerful open-source distribution of Python and R. This blog post will guide you through the process of setting up Sublime Text 3 with Anaconda, ensuring a seamless coding experience for your data science projects.

Configuring Sublime Text 3 for Anaconda: A Guide for Data Scientists

Sublime Text 3 is a popular code editor among data scientists due to its simplicity, speed, and extensibility. However, to fully leverage its capabilities, it’s crucial to configure it correctly with Anaconda, a powerful open-source distribution of Python and R. This blog post will guide you through the process of setting up Sublime Text 3 with Anaconda, ensuring a seamless coding experience for your data science projects.

Step 1: Install Sublime Text 3 and Anaconda

Before we start, make sure you have both Sublime Text 3 and Anaconda installed on your system. If not, you can download them from their official websites:

Step 2: Install Package Control in Sublime Text 3

Package Control is a package manager for Sublime Text that allows you to easily install, upgrade, and remove packages (plugins). To install Package Control, follow these steps:

  1. Open Sublime Text 3.
  2. Press `Ctrl+`` (backquote) to open the console.
  3. Paste the following code into the console and press Enter:
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

Step 3: Install Anaconda Plugin for Sublime Text 3

After installing Package Control, you can now install the Anaconda plugin. This plugin adds Python autocompletion, linting, and IDE-like features to Sublime Text. Here’s how to install it:

  1. Press Ctrl+Shift+P to open the command palette.
  2. Type Package Control: Install Package and press Enter.
  3. In the search bar that appears, type Anaconda and select it from the list.

Step 4: Configure Anaconda in Sublime Text 3

Once the Anaconda plugin is installed, you need to configure it to use the correct Python interpreter from your Anaconda distribution. Follow these steps:

  1. Go to Preferences > Package Settings > Anaconda > Settings - User.
  2. In the settings file that opens, add the following lines:
{
    "python_interpreter": "/path/to/your/anaconda/python"
}

Replace "/path/to/your/anaconda/python" with the actual path to your Anaconda Python interpreter. You can find this path by running which python (on Linux/Mac) or where python (on Windows) in your Anaconda terminal.

Step 5: Test Your Setup

Now that everything is set up, it’s time to test your configuration. Create a new Python file in Sublime Text and type some Python code. You should see autocompletion suggestions as you type, and any syntax errors will be underlined in red.

In conclusion, configuring Sublime Text 3 for Anaconda can significantly enhance your data science coding experience. By following these steps, you can enjoy a powerful, IDE-like environment within the lightweight and speedy Sublime Text editor.

Remember to keep your tools updated and explore other Sublime Text plugins that can further streamline your workflow. Happy coding!


Keywords: Sublime Text 3, Anaconda, Data Science, Python, Code Editor, Configuration, Package Control, Anaconda Plugin, Python Interpreter, Autocompletion, Linting, IDE, Workflow


About Saturn Cloud

Saturn Cloud is your all-in-one solution for data science & ML development, deployment, and data pipelines in the cloud. Spin up a notebook with 4TB of RAM, add a GPU, connect to a distributed cluster of workers, and more. Join today and get 150 hours of free compute per month.