title: Change the priority of package loading in python
body: <p>I'm working on a project based on ELK stack, it's based on <a href="https://github.com/deviantony/docker-elk" rel="nofollow noreferrer">Elk Docker structure</a>, ( you can see my directory structure in the following </p>
  
  <p><a href="https://i.stack.imgur.com/JySf0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JySf0.jpg" alt="enter image description here"></a></p>
  
  <p>My python scripts are located under <em>src</em> , and now for interact with Logstash I tried to use <a href="https://github.com/vklochan/python-logstash" rel="nofollow noreferrer">https://github.com/vklochan/python-logstash</a> package, 
  installed it with <code>pip install python-logstash</code> after I wanted to test it by the sample code provided by <code>python-logstash</code> package</p>
  
  <pre><code>import logging
  import logstash
  import sys
  
  host = 'localhost'
  
  test_logger = logging.getLogger('python-logstash-logger')
  test_logger.setLevel(logging.INFO)
  test_logger.addHandler(logstash.LogstashHandler(host, 5959, version=1))
  # test_logger.addHandler(logstash.TCPLogstashHandler(host, 5959, version=1))
  
  test_logger.error('python-logstash: test logstash error message.')
  test_logger.info('python-logstash: test logstash info message.')
  test_logger.warning('python-logstash: test logstash warning message.')
  
  # add extra field to logstash message
  extra = {
      'test_string': 'python version: ' + repr(sys.version_info),
      'test_boolean': True,
      'test_dict': {'a': 1, 'b': 'c'},
      'test_float': 1.23,
      'test_integer': 123,
      'test_list': [1, 2, '3'],
  }
  test_logger.info('python-logstash: test extra fields', extra=extra)
  </code></pre>
  
  <p>But faced with <strong>NameError: name 'logstash' is not defined</strong> it seems because I have a <code>logstash</code> directory in my root level of the project, <strong>it has higher priority than logstash package which I've been installed by pip</strong>, </p>
  
  <p><strong>How can I resolve this issue?</strong></p>
  
  <p><strong>Notice</strong> :With <code>print(sys.path)</code> I've been  sure  the priority of loading is as the following </p>
  
  <ul>
  <li>the current directory</li>
  <li>your PYTHONPATH</li>
  <li>an installation-dependent default</li>
  </ul>