macOS Install Guide - WheatonCS/Lexos GitHub Wiki

macOS Manual Installation Guide

(for current development Master branch)

Overview:

  1. About Lexos
  2. Installing Python and Anaconda
  3. Downloading and Extracting Lexos
  4. Starting and Launching Lexos
  5. Quitting Lexos

About Lexos

Lexos is an integrated workflow of tools to facilitate computational text analysis, presented in a web-based interface. Lexos is written primarily in Python 3.6 using the Flask microframework, based on Werkzeug and Jinja 2. A heavy dose of Javascript and CSS is included on the front-end. We increasingly incorporate the wiz from D3.js in our visualizations and the power in the scikit-learn modules for text and statistical processing.

Installing Python and Anaconda

If you do not already have Python v3.6 installed on your computer, we recommend installing it through the free Anaconda distribution.[1] If you already have Python, Anaconda will run alongside your current installation.

  1. Visit the Anaconda downloads page on the web: https://www.anaconda.com/download/. Locate the macOS symbol on the screen (the apple); click on this macOS link to get to Anaconda 5.2 For macOS Graphical Installer.
  2. Download the Python 3.6 version Graphical Installer by clicking on the green Download button.
  3. Double-click the installer application icon (it will be called something like Anaconda-5.2.0-MacOSX-x86_64.pkg) and follow the instructions on the screen.

When the process is complete, select Close to finish the installation of Anaconda.

You should now verify that we have installed it correctly. To do this, follow the instructions below:

  1. Open a terminal window. If you are unfamiliar with how to access a terminal window, search for “terminal” in Spotlight. You should see a window appear with a command-line prompt, typically a $.
  2. Type python -V (capital V) and hit the Enter key.

You should see a response that looks like: Python 3.6.4 :: Anaconda 5.2.0 (64-bit) If you do not see :: Anaconda 5.2.0 then your PATH variable was not updated during the Anaconda installation. We recommend that you uninstall Anaconda and try to install it again, following the instructions above. To uninstall Anaconda, type rm -rf ~/anaconda5, replacing anaconda5 with the name of the Anaconda directory, if it is different. Hit the Enter key.

Note: If any odd errors occur ensure your terminal is displaying something like mac_name:~ your_user$ as your location, otherwise exit and open a new terminal.

Downloading and Extracting Lexos

To download Lexos, enter https://github.com/WheatonCS/Lexos in your browser's address bar. This will take you to the current version of Lexos:

Under the clone or download, download the zip file.

Once the Lexos zip archive has downloaded, go into your Downloads and right-click on the zip icon, then select Open With > Archive Utility (only do this if your mac didn't automatically unzip your file for you). Choose where you would like to install Lexos and drag the folder there. If you wish, you may change the name of the extracted folder from Lexos-master to Lexos. In the instructions below, we will assume that you did this and that you extracted the Lexos folder to the Desktop.

Starting and Launching Lexos

Important: Close your current terminal window and open a new one.

In most cases, the terminal window will open in your computer's user account directory. It will show your location by displaying something like mac_name:~ your_user$. If the command prompt says something else, you may need to navigate to this folder. For help with navigation using the command line, check out this article by Macworld http://www.macworld.com/article/2042378/master-the-command-line-navigating-files-and-folders.html.

Now navigate to the Lexos folder by typing cd Desktop/Lexos and hit the Enter key. If you encounter an error, make sure that you are starting in your user account folder, that the Lexos folder is on the Desktop, and that it is called Lexos. The terminal should now display something like mac_name:Lexos your_user$.

Type pip install -r requirements.txt and hit the Enter key. This is a one time requirement to update the additional packages needed to run Lexos. When the update is completed you should see a message on your terminal window.

Now navigate to the frontend folder by typing cd Desktop/Lexos/lexos/frontend and hit the Enter key. Type npm install and hit Enter key. If you do not have npm installed follow the instructions here (you may need to restart your computer after installation). Before Lexos is ready to run you need to install the following libraries using conda:

  1. Install biopython: conda install -c anaconda biopython
  2. Install colorlover: conda install -c conda-forge colorlover
  3. Install natsort: conda install -c anaconda natsort

This will install the final requirement to run Lexos.

Type python run.py and hit the Enter key. This will start Lexos. It may take a minute to see a response the first time you run the command because Python has to reconfigure some of the project files for your computer. But shortly after you should see the following:

Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Restarting with stat
Debugger is active!
Debugger PIN: 236-087-009

Important: Keep the python run.py command running while you use Lexos. You may minimize the terminal window, but do not close it.

Once you see the message above, you are ready to launch Lexos. Go to a web browser and enter localhost:5000 in the address bar. We recommend using either Firefox or Chrome (other browsers are not supported and may not work with Lexos. You will soon see the Lexos upload page. For information about using Lexos, click the "Gear" icon at the top right of the screen.

Note: Because your computer is acting as both the web server and the user of Lexos, you may need to hit the Reset button in the top right corner of the Upload page to make sure files from any previous sessions are purged.

Note: We've noticed on that some versions of Mac OS X do not have the character encoding set to UTF-8, thus they got an error on this step. Here is a fix that has worked for us:

  1. Open a new terminal.
  2. Type cd and hit Enter.
  3. Using an editor of your choice, edit the file .bash_profile. For instance, if using “open”, type open .bash_profile.
  4. Add the following lines and then save the file (Command+s).
export LC_ALL=en_US.UTF-8 
export LANG_=en_US.UTF-8

Return to the Lexos directory and restart Lexos by entering the following commands.

cd
cd Desktop/Lexos
python run.py

Quitting Lexos

To quit Lexos simply close your browser window and close the terminal window running python run.py.

Last edited: August 24, 2018 by Scott Kleinman

[1] Anaconda is a free distribution of the Python programming language for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. As of August 2017, Anaconda includes 720+ of the most popular Python packages, including most of the packages needed for Lexos.

⚠️ **GitHub.com Fallback** ⚠️