title: System path check has TypeError: argument of type 'NoneType' is not iterable
body: <h1>Goal: To import files in a pretty manner</h1>
  
  <p>I have a piece of code (See Source) that attempts to load environment data (from a <code>.env</code> file) and then adding a specific configuration value to the system path. This supposedly enables me to import other files with the following format:</p>
  
  <pre><code>from evaluation.word_probability import WordFrequencyCounter
  </code></pre>
  
  <p>This allows me access a <code>word_probability.py</code> Python file from the <code>evaluation</code> folder using this notation, as seen in the last line of the source code below:</p>
  
  <h2>Source</h2>
  
  <pre><code>#!/usr/bin/env python3
  import sys
  from dotenv import load_dotenv, find_dotenv
  from os import environ
  
  # Add python project root folder to python path
  load_dotenv(find_dotenv(), override=True, verbose=False)
  PYTHON_SCRIPTS_DIR = environ.get('PYTHON_SCRIPTS_DIR')
  PROJECT_DIR = environ.get('PROJECT_DIR')
  sys.path.insert(0, PYTHON_SCRIPTS_DIR)
  
  from evaluation.word_probability import WordFrequencyCounter
  </code></pre>
  
  <h1>The problem</h1>
  
  <p>The problem I'm encountering is that when I run my python script, it tells me that it could not iterate on a <code>NoneType</code>:</p>
  
  <h3>Error message</h3>
  
  <pre><code>Traceback (most recent call last):
    File "python/word_frequencies.py", line 13, in &lt;module&gt;
      from evaluation.word_probability import WordFrequencyCounter
    File "/Users/darrenkarlsapalo/git/thesis/thesis-nltk/python/evaluation/word_probability.py", line 16, in &lt;module&gt;
      from nltk.corpus import stopwords
    File "/Users/darrenkarlsapalo/.local/share/virtualenvs/thesis-nltk-QvwJevGq/lib/python3.6/site-packages/nltk/__init__.py", line 115, in &lt;module&gt;
      from nltk.decorators import decorator, memoize
    File "/Users/darrenkarlsapalo/.local/share/virtualenvs/thesis-nltk-QvwJevGq/lib/python3.6/site-packages/nltk/decorators.py", line 23, in &lt;module&gt;
      sys.path = [p for p in sys.path if "nltk" not in p]
    File "/Users/darrenkarlsapalo/.local/share/virtualenvs/thesis-nltk-QvwJevGq/lib/python3.6/site-packages/nltk/decorators.py", line 23, in &lt;listcomp&gt;
      sys.path = [p for p in sys.path if "nltk" not in p]
  TypeError: argument of type 'NoneType' is not iterable
  </code></pre>
  
  <p>How do I fix this? I just want my script to run but it's not continuing past the imports.</p>