title: Problems getting Falcon to run on Mac
body: <p>I'm having a challenge running Falcon on my Mac.  I'm using python 2.7 along with pycharm for some time with no issues.</p>
  
  <p>There seems to be several related posts <a href="https://stackoverflow.com/questions/6643052/importerror-no-module-named-http-cookies-error-when-installing-cherrypy-3-2">here</a> , <a href="https://github.com/falconry/falcon/issues/81" rel="nofollow noreferrer">here</a>, and <a href="http://python.6.x6.nabble.com/CherryPy-3-2-2-No-module-named-Cookie-td4335625.html" rel="nofollow noreferrer">here</a>, but still seem to have the same problem.</p>
  
  <p>I've spent many hours trying to get this to work and everything appears to point to the six package and SSL.</p>
  
  <p>Following are my efforts so far.  Any help greatly appreciated</p>
  
  <pre><code>MYMACBOOKPRO:falcon my.user$ sw_vers -productVersion
  10.10.2
  
  MYMACBOOKPRO:falcon my.user$ python --version
  Python 2.7.10
  
  MYMACBOOKPRO:falcon my.user$ pip install six --upgrade
  Requirement already up-to-date: six in /Library/Python/2.7/site-packages
  
  MYMACBOOKPRO:falcon my.user$ sudo pip install pyopenssl ndg-httpsclient
  Password:
  The directory '/Users/my.user/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  The directory '/Users/my.user/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  Requirement already satisfied (use --upgrade to upgrade): pyopenssl in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
  Requirement already satisfied (use --upgrade to upgrade): ndg-httpsclient in /Library/Python/2.7/site-packages
  
  MYMACBOOKPRO:falcon my.user$ sudo pip install six --upgrade
  The directory '/Users/my.user/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  The directory '/Users/my.user/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  Requirement already up-to-date: six in /Library/Python/2.7/site-packages
  
  MYMACBOOKPRO:falcon my.user$ sudo pip install pyopenssl ndg-httpsclient
  The directory '/Users/my.user/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  The directory '/Users/my.user/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  Requirement already satisfied (use --upgrade to upgrade): pyopenssl in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
  Requirement already satisfied (use --upgrade to upgrade): ndg-httpsclient in /Library/Python/2.7/site-packages
  
  MYMACBOOKPRO:falcon my.user$ openssl version
  OpenSSL 1.0.2d 9 Jul 2015
  
  MYMACBOOKPRO:falcon my.user$ sudo pip install gunicorn --upgrade
  The directory '/Users/my.user/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  The directory '/Users/my.user/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  Requirement already up-to-date: gunicorn in /Library/Python/2.7/site-package
  
  MYMACBOOKPRO:falcon my.user$ cat things.py
  # things.py
  
  # Let's get this party started
  import falcon
  
  
  # Falcon follows the REST architectural style, meaning (among
  # other things) that you think in terms of resources and state
  # transitions, which map to HTTP verbs.
  class ThingsResource:
      def on_get(self, req, resp):
          """Handles GET requests"""
          resp.status = falcon.HTTP_200  # This is the default status
          resp.body = ('\nTwo things awe me most, the starry sky '
                       'above me and the moral law within me.\n'
                       '\n'
                       '    ~ Immanuel Kant\n\n')
  
  # falcon.API instances are callable WSGI apps
  app = falcon.API()
  
  # Resources are represented by long-lived class instances
  things = ThingsResource()
  
  # things will handle all requests to the '/things' URL path
  app.add_route('/things', things)
  
  MYMACBOOKPRO:falcon my.user$ gunicorn things:app
  [2015-11-20 08:38:42 -0500] [66479] [INFO] Starting gunicorn 19.3.0
  [2015-11-20 08:38:42 -0500] [66479] [INFO] Listening at: http://127.0.0.1:8000 (66479)
  [2015-11-20 08:38:42 -0500] [66479] [INFO] Using worker: sync
  [2015-11-20 08:38:42 -0500] [66482] [INFO] Booting worker with pid: 66482
  [2015-11-20 08:38:42 -0500] [66482] [ERROR] Exception in worker process:
  Traceback (most recent call last):
    File "/Library/Python/2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
      worker.init_process()
    File "/Library/Python/2.7/site-packages/gunicorn/workers/base.py", line 118, in init_process
      self.wsgi = self.app.wsgi()
    File "/Library/Python/2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
      self.callable = self.load()
    File "/Library/Python/2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
      return self.load_wsgiapp()
    File "/Library/Python/2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
      return util.import_app(self.app_uri)
    File "/Library/Python/2.7/site-packages/gunicorn/util.py", line 355, in import_app
      __import__(module)
    File "/Users/my.user/falcon/things.py", line 4, in &lt;module&gt;
      import falcon
    File "/Library/Python/2.7/site-packages/falcon/__init__.py", line 32, in &lt;module&gt;
      from falcon.api import API, DEFAULT_MEDIA_TYPE  # NOQA
    File "/Library/Python/2.7/site-packages/falcon/api.py", line 22, in &lt;module&gt;
      from falcon.request import Request, RequestOptions
    File "/Library/Python/2.7/site-packages/falcon/request.py", line 35, in &lt;module&gt;
      from six.moves.http_cookies import SimpleCookie
  ImportError: No module named http_cookies
  Traceback (most recent call last):
    File "/Library/Python/2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
      worker.init_process()
    File "/Library/Python/2.7/site-packages/gunicorn/workers/base.py", line 118, in init_process
      self.wsgi = self.app.wsgi()
    File "/Library/Python/2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
      self.callable = self.load()
    File "/Library/Python/2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
      return self.load_wsgiapp()
    File "/Library/Python/2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
      return util.import_app(self.app_uri)
    File "/Library/Python/2.7/site-packages/gunicorn/util.py", line 355, in import_app
      __import__(module)
    File "/Users/my.user/falcon/things.py", line 4, in &lt;module&gt;
      import falcon
    File "/Library/Python/2.7/site-packages/falcon/__init__.py", line 32, in &lt;module&gt;
      from falcon.api import API, DEFAULT_MEDIA_TYPE  # NOQA
    File "/Library/Python/2.7/site-packages/falcon/api.py", line 22, in &lt;module&gt;
      from falcon.request import Request, RequestOptions
    File "/Library/Python/2.7/site-packages/falcon/request.py", line 35, in &lt;module&gt;
      from six.moves.http_cookies import SimpleCookie
  ImportError: No module named http_cookies
  [2015-11-20 08:38:42 -0500] [66482] [INFO] Worker exiting (pid: 66482)
  Traceback (most recent call last):
    File "/usr/local/bin/gunicorn", line 11, in &lt;module&gt;
      sys.exit(run())
    File "/Library/Python/2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
      WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
    File "/Library/Python/2.7/site-packages/gunicorn/app/base.py", line 189, in run
      super(Application, self).run()
    File "/Library/Python/2.7/site-packages/gunicorn/app/base.py", line 72, in run
      Arbiter(self).run()
    File "/Library/Python/2.7/site-packages/gunicorn/arbiter.py", line 174, in run
      self.manage_workers()
    File "/Library/Python/2.7/site-packages/gunicorn/arbiter.py", line 477, in manage_workers
      self.spawn_workers()
    File "/Library/Python/2.7/site-packages/gunicorn/arbiter.py", line 541, in spawn_workers
      time.sleep(0.1 * random.random())
    File "/Library/Python/2.7/site-packages/gunicorn/arbiter.py", line 214, in handle_chld
      self.reap_workers()
    File "/Library/Python/2.7/site-packages/gunicorn/arbiter.py", line 459, in reap_workers
      raise HaltServer(reason, self.WORKER_BOOT_ERROR)
  gunicorn.errors.HaltServer: &lt;HaltServer 'Worker failed to boot.' 3&gt;
  </code></pre>