Skip to content

more descriptive installation instructions for non academic, citizen users

Emanuel Faria edited this page Jul 27, 2022 · 1 revision

Think of my edits below as me writing in the margin of the original docanalysis README copy as I tried and failed to install pip, python, docanalysis etc... It still needs work.

<!doctype html>

installing docanalysis

before you install...

IMPORTANT: To avoid preventable errors and conflicts with programs already on your machine it is important that you perform the following installations in the same terminal window, and do so in the order specified here.

The steps, which will be explained below, must occur in the following order:

  1. Find and launch the “terminal.app” on your machine and open a new window (if a blank one is not immediately opened for you.)

  2. Install pip — the tool you will use to install and manage docanalysis, and [python] the base* *upon which all of the “tools" in our “toolbox” operate.

  3. Set up a venv — short for "virtual environment”, your venv is where you'll install the specific compatible version of python required to run docanalyis without creating conflicts or with any other programs on your machine.

  4. Use pip to install docanalysis in your venv

instructions

1. open new terminal window

Find and launch the “terminal.app” on your machine and open a new window (if a blank one is not immediately opened for you.) Remember, it important that you perform the following installations on your machine in the same terminal window.

 

2. install pip

Pip is one of the best tools to install and manage Python packages. (python is the computer *programming language which, in our case, functions as a mini “operating system” (think, Windows or MacOS) upon which docanalysis and all the other tools (sub-programs) in our “toolbox” (docanalysis suite) operate.

<!doctype html>

Windows MacOs/Unix
  sudo apt-get -y install python3-pip
  When prompted, type in your computer password (Admin privileges will be needed), then return/enter
 

⛔️seems to require installing python first⛔️ https://pip.pypa.io/en/stable/installation/

Install pip (pip3 on MacOS) from [papa.io](https://pip.pypa.io/en/stable/installation/) ()

 

3. Set up a Virtual Environment (venv)

Your venv is where you'll install the specific compatible version of python required to run docanalyis without creating conflicts or with any other programs on your machine.

In practice you will create a uniquely name directory (folder) for each docanalysis project you undertake, but in these instructions, we will create a venv inside a directory (folder)

 

To create and activate a virtual environment, in your [terminal window](https://en.wikipedia.org/wiki/Terminal_emulator) enter each of the commands below followed by the return/enter key.<!doctype html>

Explanation Windows/Unix   MacOS Explanation
Change​​ Directory (used to change the current working directory)(Ensures you're starting the following procedures from your home (base?) directory. CD\   cd Change​​ Directory (Ensures you're beginning from your home (base) directory)
      python3.8 -m pip3 install --user --upgrade pip  
      python3.8 -m pip3 install --user virtualenv  
Makes a new directory folder in your home directory mkdir docanalysis_DEMO   mkdir docanalysis_ Creates a new directory (folder) in your home directory
Change current working directory to the one you just created. cd docanalysis_DEMO   cd docanalysis_ moves terminal window to this directory
Create a new sub-directory to contain your venv python -m venv venv   python3.8 -m venv venv I found that by adding “.8” that the venv was installed with python 3.8 already in it!
Activate the venv venv\Scripts\activate.bat   source venv/bin/activate  
         
 

⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️ VERIFY THIS PLEASE ⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️

🔔🔔 IMPORTANT!! 🔔🔔

  1. You will need to activate (launch) the required venv every time you run docanalysis and deactivate (quit) it thereafter.

  2. You must perform all of your docanalysis operations from this same window where you’ve activated your venv, otherwise you will have to repeat steps 3 and 5 above

  3. You will need to deactivate the venv every time you run docanalysis and cd back to your home folder (windows only??)

⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️

 

4. install python in your venv

  1. Download python from: https://www.python.org/downloads/.

  2. When running the installer, select the option Add Python to Path while installing (windows only).

  3. Make sure pip is installed along with python. If you have difficulties installing pip, see https://pip.pypa.io/en/stable/installation/.

!!⛔️⛔️ What if python is already installed? Can we have everything scripted (including venv activation) to install and run docanalyis? ⛔️⛔️!!

!!⛔️⛔️ Mac installer does not offer option to add python to PATH. (What is path?) ⛔️⛔️

!!⛔️⛔️ Would it make sense to install PIP before python into the venv? (As I did above)⛔️⛔️

!!⛔️⛔️ What if someone already has created a venv for another program? can we name the venv something specific to docanalysis ⛔️⛔️!!

 

5. install docanalysis in your venv

!!⛔️⛔️ Do docanalysis and Python need to be installed from the terminal window where the venv was just activated? (vs virtualnv) ⛔️⛔️!!

You can download docanalysis from PYPI at https://pypi.org/project/docanalysis/ or, you can install docanalysis from the terminal using the following command:

 <!doctype html>

Windows MacOS/Unix
pip install docanalysis pip3 install docanalysis==0.1.4