Repository: conda/conda

Issue:
`conda activate` results in `KeyError` when no environment variable `PATH` is set


**I'm submitting a...**
  - [x] bug report
  - [ ] feature request


## Current Behavior
<!-- What actually happens?
     If you want to include console output, please use "Steps to Reproduce" below. -->

When no PATH environment is set, `conda activate` results in a `KeyError`.  The `self.environ['PATH']` should probably be replaced by `self.environ.get('PATH', '')` or something similar.

### Steps to Reproduce
<!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce.
     Include the exact conda commands that reproduce the issue and their output between the ticks below. -->
```
$ env -i bash --norc --noprofile
bash-4.1$ /path/to/conda/anaconda3/bin/conda shell.posix activate

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 98, in main
        return activator_main()
      File "/group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/lib/python3.6/site-packages/conda/activate.py", line 584, in main
        print(activator.execute(), end='')
      File "/group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/lib/python3.6/site-packages/conda/activate.py", line 157, in execute
        return getattr(self, self.command)()
      File "/group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/lib/python3.6/site-packages/conda/activate.py", line 143, in activate
        return self._finalize(self._yield_commands(self.build_activate(self.env_name_or_prefix)),
      File "/group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/lib/python3.6/site-packages/conda/activate.py", line 244, in build_activate
        new_path = self.pathsep_join(self._add_prefix_to_path(prefix))
      File "/group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/lib/python3.6/site-packages/conda/activate.py", line 417, in _add_prefix_to_path
        starting_path_dirs = self._get_starting_path_list()
      File "/group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/lib/python3.6/site-packages/conda/activate.py", line 384, in _get_starting_path_list
        path = self.environ['PATH']
    KeyError: 'PATH'

`$ /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/bin/conda shell.posix activate`

  environment variables:
                 CIO_TEST=<not set>
               CONDA_ROOT=/group_workspaces/cems2/fiduceo/Users/gholl/anaconda3
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : None
       user config file : /home/users/gholl/.condarc
 populated config files : /home/users/gholl/.condarc
          conda version : 4.5.4
    conda-build version : 3.0.27
         python version : 3.6.3.final.0
       base environment : /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3  (writable)
           channel URLs : https://conda.anaconda.org/rttools/linux-64
                          https://conda.anaconda.org/rttools/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/linux-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/linux-64
                          https://repo.anaconda.com/pkgs/pro/noarch
          package cache : /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/pkgs
                          /home/users/gholl/.conda/pkgs
       envs directories : /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/envs
                          /home/users/gholl/.conda/envs
               platform : linux-64
             user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.3 Linux/2.6.32-754.el6.x86_64 rhel/6.10 glibc/2.12
                UID:GID : 35063:26030
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.
Upload successful.

```


## Expected Behavior
<!-- What do you think should happen? -->

I think `conda activate` should work as it otherwise does, and create a `PATH` variable with exactly one directory in it.

## Environment Information
<details open><summary><code>`conda info`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda info' -->

```
     active environment : None
       user config file : /home/users/gholl/.condarc
 populated config files : /home/users/gholl/.condarc
          conda version : 4.5.4
    conda-build version : 3.0.27
         python version : 3.6.3.final.0
       base environment : /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3  (writable)
           channel URLs : https://conda.anaconda.org/rttools/linux-64
                          https://conda.anaconda.org/rttools/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/linux-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/linux-64
                          https://repo.anaconda.com/pkgs/pro/noarch
          package cache : /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/pkgs
                          /home/users/gholl/.conda/pkgs
       envs directories : /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/envs
                          /home/users/gholl/.conda/envs
               platform : linux-64
             user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.3 Linux/2.6.32-754.el6.x86_64 rhel/6.10 glibc/2.12
                UID:GID : 35063:26030
             netrc file : None
           offline mode : False

```
</p></details>


<details open><summary><code>`conda config --show-sources`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda config --show-sources' -->

```
==> /home/users/gholl/.condarc <==
channels:
  - rttools
  - conda-forge
  - defaults
report_errors: True
```
</p></details>


<details><summary><code>`conda list --show-channel-urls`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda list --show-channel-urls' -->

```
# packages in environment at /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3:
#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0            py36he11e457_0    defaults
alabaster                 0.7.10           py36h306e16b_0    defaults
anaconda                  custom           py36hbbc8b67_0    defaults
anaconda-client           1.6.5            py36h19c0dcd_0    defaults
anaconda-navigator        1.6.9            py36h11ddaaa_0    defaults
anaconda-project          0.8.0            py36h29abdf5_0    defaults
asn1crypto                0.22.0           py36h265ca7c_1    defaults
astroid                   1.5.3            py36hbdb9df2_0    defaults
astropy                   2.0.2            py36ha51211e_4    defaults
babel                     2.5.0            py36h7d14adf_0    defaults
backports                 1.0              py36hfa02d7e_1    defaults
backports.shutil_get_terminal_size 1.0.0            py36hfea85ff_2    defaults
beautifulsoup4            4.6.0            py36h49b8c8c_1    defaults
bitarray                  0.8.1            py36h5834eb8_0    defaults
bkcharts                  0.2              py36h735825a_0    defaults
blaze                     0.11.3           py36h4e06776_0    defaults
bleach                    2.0.0            py36h688b259_0    defaults
bokeh                     0.12.10          py36hbb0e44a_0    defaults
boto                      2.48.0           py36h6e4cd66_1    defaults
bottleneck                1.2.1            py36haac1ea0_0    defaults
bzip2                     1.0.6                h0376d23_1    defaults
ca-certificates           2017.08.26           h1d4fec5_0    defaults
cairo                     1.14.10              haa5651f_5    defaults
certifi                   2017.7.27.1      py36h8b7b77e_0    defaults
cffi                      1.10.0           py36had8d393_1    defaults
chardet                   3.0.4            py36h0f667ec_1    defaults
click                     6.7              py36h5253387_0    defaults
cloudpickle               0.4.0            py36h30f8c20_0    defaults
clyent                    1.2.2            py36h7e57e65_1    defaults
colorama                  0.3.9            py36h489cec4_0    defaults
conda                     4.5.4                    py36_0    conda-forge
conda-build               3.0.27           py36h940a66d_0    defaults
conda-env                 2.6.0                h36134e3_1    defaults
conda-verify              2.0.0            py36h98955d8_0    defaults
contextlib2               0.5.5            py36h6c84a62_0    defaults
cryptography              2.0.3            py36ha225213_1    defaults
curl                      7.55.1               hcb0b314_2    defaults
cycler                    0.10.0           py36h93f1223_0    defaults
cython                    0.26.1           py36h21c49d0_0    defaults
cytoolz                   0.8.2            py36h708bfd4_0    defaults
dask                      0.15.3           py36hdc2c8aa_0    defaults
dask-core                 0.15.3           py36h10e6167_0    defaults
datashape                 0.5.4            py36h3ad6b5c_0    defaults
dbus                      1.10.22              h3b5a359_0    defaults
decorator                 4.1.2            py36hd076ac8_0    defaults
distributed               1.19.1           py36h25f3894_0    defaults
docutils                  0.14             py36hb0f60f5_0    defaults
entrypoints               0.2.3            py36h1aec115_2    defaults
et_xmlfile                1.0.1            py36hd6bccc3_0    defaults
expat                     2.2.4                hc00ebd1_1    defaults
fastcache                 1.0.2            py36h5b0c431_0    defaults
filelock                  2.0.12           py36hacfa1f5_0    defaults
flask                     0.12.2           py36hb24657c_0    defaults
flask-cors                3.0.3            py36h2d857d3_0    defaults
fontconfig                2.12.4               h88586e7_1    defaults
freetype                  2.8                  h52ed37b_0    defaults
get_terminal_size         1.0.0                haa9412d_0    defaults
gevent                    1.2.2            py36h2fe25dc_0    defaults
glib                      2.53.6               hc861d11_1    defaults
glob2                     0.5              py36h2c1b292_1    defaults
gmp                       6.1.2                hb3b607b_0    defaults
gmpy2                     2.0.8            py36h55090d7_1    defaults
graphite2                 1.3.10               hc526e54_0    defaults
greenlet                  0.4.12           py36h2d503a6_0    defaults
gst-plugins-base          1.12.2               he3457e5_0    defaults
gstreamer                 1.12.2               h4f93127_0    defaults
h5py                      2.7.0            py36he81ebca_1    defaults
harfbuzz                  1.5.0                h2545bd6_0    defaults
hdf5                      1.10.1               hb0523eb_0    defaults
heapdict                  1.0.0            py36h79797d7_0    defaults
html5lib                  0.999999999      py36h2cfc398_0    defaults
icu                       58.2                 h211956c_0    defaults
idna                      2.6              py36h82fb2a8_1    defaults
imageio                   2.2.0            py36he555465_0    defaults
imagesize                 0.7.1            py36h52d8127_0    defaults
intel-openmp              2018.0.0             h15fc484_7    defaults
ipykernel                 4.6.1            py36hbf841aa_0    defaults
ipython                   6.1.0            py36hc72a948_1    defaults
ipython_genutils          0.2.0            py36hb52b0d5_0    defaults
ipywidgets                7.0.0            py36h7b55c3a_0    defaults
isort                     4.2.15           py36had401c0_0    defaults
itsdangerous              0.24             py36h93cc618_1    defaults
jbig                      2.1                  hdba287a_0    defaults
jdcal                     1.3              py36h4c697fb_0    defaults
jedi                      0.10.2           py36h552def0_0    defaults
jinja2                    2.9.6            py36h489bce4_1    defaults
jpeg                      9b                   habf39ab_1    defaults
jsonschema                2.6.0            py36h006f8b5_0    defaults
jupyter                   1.0.0            py36h9896ce5_0    defaults
jupyter_client            5.1.0            py36h614e9ea_0    defaults
jupyter_console           5.2.0            py36he59e554_1    defaults
jupyter_core              4.3.0            py36h357a921_0    defaults
jupyterlab                0.27.0           py36h86377d0_2    defaults
jupyterlab_launcher       0.4.0            py36h4d8058d_0    defaults
lazy-object-proxy         1.3.1            py36h10fcdad_0    defaults
libedit                   3.1                  heed3624_0    defaults
libffi                    3.2.1                h4deb6c0_3    defaults
libgcc-ng                 7.2.0                h7cc24e2_2    defaults
libgfortran-ng            7.2.0                h9f7466a_2    defaults
libpng                    1.6.32               hda9c8bc_2    defaults
libsodium                 1.0.13               h31c71d8_2    defaults
libssh2                   1.8.0                h8c220ad_2    defaults
libstdcxx-ng              7.2.0                h7a57d05_2    defaults
libtiff                   4.0.8                h90200ff_9    defaults
libtool                   2.4.6                hd50d1a6_0    defaults
libxcb                    1.12                 h84ff03f_3    defaults
libxml2                   2.9.4                h6b072ca_5    defaults
libxslt                   1.1.29               hcf9102b_5    defaults
llvmlite                  0.20.0                   py36_0    defaults
locket                    0.2.0            py36h787c0ad_1    defaults
lxml                      4.1.0            py36h5b66e50_0    defaults
lzo                       2.10                 h1bfc0ba_1    defaults
markupsafe                1.0              py36hd9260cd_1    defaults
matplotlib                2.1.0            py36hba5de38_0    defaults
mccabe                    0.6.1            py36h5ad9710_1    defaults
mistune                   0.7.4            py36hbab8784_0    defaults
mkl                       2018.0.0             hb491cac_4    defaults
mkl-service               1.1.2            py36h17a0993_4    defaults
mpc                       1.0.3                hf803216_4    defaults
mpfr                      3.1.5                h12ff648_1    defaults
mpmath                    0.19             py36h8cc018b_2    defaults
msgpack-python            0.4.8            py36hec4c5d1_0    defaults
multipledispatch          0.4.9            py36h41da3fb_0    defaults
navigator-updater         0.1.0            py36h14770f7_0    defaults
nbconvert                 5.3.1            py36hb41ffb7_0    defaults
nbformat                  4.4.0            py36h31c9010_0    defaults
ncurses                   6.0                  h06874d7_1    defaults
networkx                  2.0              py36h7e96fb8_0    defaults
nltk                      3.2.4            py36h1a0979f_0    defaults
nose                      1.3.7            py36hcdf7029_2    defaults
notebook                  5.0.0            py36h0b20546_2    defaults
numba                     0.35.0             np113py36_10    defaults
numexpr                   2.6.2            py36hdd3393f_1    defaults
numpy                     1.13.3           py36ha12f23b_0    defaults
numpydoc                  0.7.0            py36h18f165f_0    defaults
odo                       0.5.1            py36h90ed295_0    defaults
olefile                   0.44             py36h79f9f78_0    defaults
openpyxl                  2.4.8            py36h41dd2a8_1    defaults
openssl                   1.0.2l               h077ae2c_5    defaults
packaging                 16.8             py36ha668100_1    defaults
pandas                    0.20.3           py36h842e28d_2    defaults
pandoc                    1.19.2.1             hea2e7c5_1    defaults
pandocfilters             1.4.2            py36ha6701b7_1    defaults
pango                     1.40.11              h8191d47_0    defaults
partd                     0.3.8            py36h36fd896_0    defaults
patchelf                  0.9                  hf79760b_2    defaults
path.py                   10.3.1           py36he0c6f6d_0    defaults
pathlib2                  2.3.0            py36h49efa8e_0    defaults
patsy                     0.4.1            py36ha3be15e_0    defaults
pcre                      8.41                 hc71a17e_0    defaults
pep8                      1.7.0            py36h26ade29_0    defaults
pexpect                   4.2.1            py36h3b9d41b_0    defaults
pickleshare               0.7.4            py36h63277f8_0    defaults
pillow                    4.2.1            py36h9119f52_0    defaults
pip                       9.0.1            py36h8ec8b28_3    defaults
pixman                    0.34.0               h83dc358_2    defaults
pkginfo                   1.4.1            py36h215d178_1    defaults
ply                       3.10             py36hed35086_0    defaults
prompt_toolkit            1.0.15           py36h17d85b1_0    defaults
psutil                    5.4.0            py36h84c53db_0    defaults
ptyprocess                0.5.2            py36h69acd42_0    defaults
py                        1.4.34           py36h0712aa3_1    defaults
pycodestyle               2.3.1            py36hf609f19_0    defaults
pycosat                   0.6.3                    py36_0    conda-forge
pycparser                 2.18             py36hf9f622e_1    defaults
pycrypto                  2.6.1            py36h6998063_1    defaults
pycurl                    7.43.0           py36h5e72054_3    defaults
pyflakes                  1.6.0            py36h7bd6a15_0    defaults
pygments                  2.2.0            py36h0d3125c_0    defaults
pylint                    1.7.4            py36hb9d4533_0    defaults
pyodbc                    4.0.17           py36h999153c_0    defaults
pyopenssl                 17.2.0           py36h5cc804b_0    defaults
pyparsing                 2.2.0            py36hee85983_1    defaults
pyqt                      5.6.0            py36h0386399_5    defaults
pysocks                   1.6.7            py36hd97a5b1_1    defaults
pytables                  3.4.2            py36h3b5282a_2    defaults
pytest                    3.2.1            py36h11ad3bb_1    defaults
python                    3.6.3                hc9025b9_1    defaults
python-dateutil           2.6.1            py36h88d3b88_1    defaults
pytz                      2017.2           py36hc2ccc2a_1    defaults
pywavelets                0.5.2            py36he602eb0_0    defaults
pyyaml                    3.12             py36hafb9ca4_1    defaults
pyzmq                     16.0.2           py36h3b0cf96_2    defaults
qt                        5.6.2               h974d657_12    defaults
qtawesome                 0.4.4            py36h609ed8c_0    defaults
qtconsole                 4.3.1            py36h8f73b5b_0    defaults
qtpy                      1.3.1            py36h3691cc8_0    defaults
readline                  7.0                  hac23ff0_3    defaults
requests                  2.18.4           py36he2e5f8d_1    defaults
rope                      0.10.5           py36h1f8c17e_0    defaults
ruamel_yaml               0.11.14          py36ha2fb22d_2    defaults
scikit-image              0.13.0           py36had3c07a_1    defaults
scikit-learn              0.19.1           py36h7aa7ec6_0    defaults
scipy                     0.19.1           py36h9976243_3    defaults
seaborn                   0.8.0            py36h197244f_0    defaults
setuptools                36.5.0           py36he42e2e1_0    defaults
simplegeneric             0.8.1            py36h2cb9092_0    defaults
singledispatch            3.4.0.3          py36h7a266c3_0    defaults
sip                       4.18.1           py36h51ed4ed_2    defaults
six                       1.11.0           py36h372c433_1    defaults
snowballstemmer           1.2.1            py36h6febd40_0    defaults
sortedcollections         0.5.3            py36h3c761f9_0    defaults
sortedcontainers          1.5.7            py36hdf89491_0    defaults
sphinx                    1.6.3            py36he5f0bdb_0    defaults
sphinxcontrib             1.0              py36h6d0f590_1    defaults
sphinxcontrib-websupport  1.0.1            py36hb5cb234_1    defaults
spyder                    3.2.4            py36hbe6152b_0    defaults
sqlalchemy                1.1.13           py36hfb5efd7_0    defaults
sqlite                    3.20.1               h6d8b0f3_1    defaults
statsmodels               0.8.0            py36h8533d0b_0    defaults
sympy                     1.1.1            py36hc6d1c1c_0    defaults
tblib                     1.3.2            py36h34cf8b6_0    defaults
terminado                 0.6              py36ha25a19f_0    defaults
testpath                  0.3.1            py36h8cadb63_0    defaults
tk                        8.6.7                h5979e9b_1    defaults
toolz                     0.8.2            py36h81f2dff_0    defaults
tornado                   4.5.2            py36h1283b2a_0    defaults
traitlets                 4.3.2            py36h674d592_0    defaults
typing                    3.6.2            py36h7da032a_0    defaults
unicodecsv                0.14.1           py36ha668878_0    defaults
unixodbc                  2.3.4                hc36303a_1    defaults
urllib3                   1.22             py36hbe7ace6_0    defaults
wcwidth                   0.1.7            py36hdf4376a_0    defaults
webencodings              0.5.1            py36h800622e_1    defaults
werkzeug                  0.12.2           py36hc703753_0    defaults
wheel                     0.29.0           py36he7f4e38_1    defaults
widgetsnbextension        3.0.2            py36hd01bb71_1    defaults
wrapt                     1.10.11          py36h28b7045_0    defaults
xlrd                      1.1.0            py36h1db9f0c_1    defaults
xlsxwriter                1.0.2            py36h3de1aca_0    defaults
xlwt                      1.3.0            py36h7b00a1f_0    defaults
xz                        5.2.3                h2bcbf08_1    defaults
yaml                      0.1.7                h96e3832_1    defaults
zeromq                    4.2.2                hb0b69da_1    defaults
zict                      0.1.3            py36h3a3bf81_0    defaults
zlib                      1.2.11               hfbfcf68_1    defaults
```
</p></details>



Discussion:

Resolving patch:
diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -390,7 +390,7 @@ def build_reactivate(self):
         }
 
     def _get_starting_path_list(self):
-        path = self.environ['PATH']
+        path = self.environ.get('PATH', '')
         if on_win:
             # On Windows, the Anaconda Python interpreter prepends sys.prefix\Library\bin on
             # startup. It's a hack that allows users to avoid using the correct activation


Test patch: