Skip to content

Commit

Permalink
docs: Creating instructions for Windows users to install sam (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwarzwalder authored and jfuss committed Aug 7, 2018
1 parent 4cbb277 commit 4c96f09
Showing 1 changed file with 53 additions and 4 deletions.
57 changes: 53 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,40 @@ containers – SAM CLI will do it automatically as required.
Windows, Linux, macOS with PIP
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Verify Python Version is 2.7 or 3.6.
Step 1. Verify Python Version is 2.7 or 3.6.

.. code:: bash
$ python --version
If not installed, go `download python and install <https://www.python.org/downloads/>`_

Step 2. Verify Pip is installed.

The easiest way to install ``sam`` is to use
`PIP <https://pypi.org/>`__.

.. code:: bash
$ pip --version
If not installed, `download and install pip <https://pip.pypa.io/en/stable/installing/>`_

Step 3. Install aws-sam-cli

.. code:: bash
$ pip install --user aws-sam-cli
**Adjust your PATH** to include Python scripts installed under User's directory.
Step 4. **Adjust your PATH** to include Python scripts installed under User's directory.

macOS & Linux
^^^^^^^^^^^^^

In Unix/Mac systems the command ``python -m site --user-base`` typically print ``~/.local`` path, so that you'll need to add ``/bin`` to obtain the script path

**NOTE**: As explained in the `Python Developer's Guide <https://www.python.org/dev/peps/pep-0370/#specification>`__, the User's directory where the scripts are installed is ``~/.local/bin`` for Unix/Mac and ``%APPDATA%\Python\Scripts`` for Windows.
**NOTE**: As explained in the `Python Developer's Guide <https://www.python.org/dev/peps/pep-0370/#specification>`__, the User's directory where the scripts are installed is ``~/.local/bin`` for Unix/Mac.

The Python command can help to detect the correct path. However, in Unix/Mac systems the command ``python -m site --user-base`` typically print ``~/.local`` path, so that you'll need to add ``/bin`` to obtain the script path, while in Windows systems the command ``py -m site --user-site`` typically print ``%APPDATA%\Roaming\Python<VERSION>\site-packages``, so you'll need to remove the last ``\site-packages`` folder and replace it with the ``\Scripts`` one.

.. code:: bash
Expand All @@ -159,6 +175,39 @@ Restart or Open up a new terminal and verify that the installation worked:
# Restart current shell
$ exec "$SHELL"
$ sam --version
Windows
^^^^^^^

In Windows systems the command ``py -m site --user-site`` typically print ``%APPDATA%\Roaming\Python<VERSION>\site-packages``, so you'll need to remove the last ``\site-packages`` folder and replace it with the ``\Scripts`` one.

.. code:: bash
$ python -m site --user-base
Using file explorer, go to the folder indicated in the output, and look for the ``Scripts`` folder. Visually confirm that sam Application is inside this folder.

Copy the File Path.

**NOTE**: As explained in the `Python Developer's Guide <https://www.python.org/dev/peps/pep-0370/#specification>`__, the User's directory where the scripts are installed is ``%APPDATA%\Python\Scripts`` for Windows.

Seach Windows for ``Edit the system environment variables``.

Select **Enviromental Variables**.

Under **System variables**, select **Path**.

Select **New** and enter the file path to the Python Scripts folder.

Step 5. Verify that sam is installed

Restart or Open up a new terminal and verify that the installation worked:

.. code:: bash
# Restart current shell
$ sam --version
Upgrading
~~~~~~~~~~
Expand Down

0 comments on commit 4c96f09

Please sign in to comment.