title: Basemap import error in PyCharm — KeyError: 'PROJ_LIB'
body: <p>I tried to use Basemap package to plot a map by PyCharm, but I got something wrong with</p>
  
  <pre><code>from mpl_toolkits.basemap import Basemap`
  </code></pre>
  
  <p>And the Traceback as followed:</p>
  
  <pre><code>Traceback (most recent call last):
  File "/Users/yupeipei/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2963, in run_code
      exec(code_obj, self.user_global_ns, self.user_ns)
    File "&lt;ipython-input-4-0a24a3a77efd&gt;", line 7, in &lt;module&gt;
      from mpl_toolkits.basemap import Basemap
    File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 20, in do_import
      module = self._system_import(name, *args, **kwargs)
    File "/Users/yupeipei/anaconda3/lib/python3.6/site-packages/mpl_toolkits/basemap/__init__.py", line 146, in &lt;module&gt;
      pyproj_datadir = os.environ['PROJ_LIB']
    File "/Users/yupeipei/anaconda3/lib/python3.6/os.py", line 669, in __ getitem__
      raise KeyError(key) from None
  KeyError: 'PROJ_LIB'
  </code></pre>
  
  <p>I'm confused with this error on PyCharm, because the same script is running correctly on Jupyter or Spyder! The environment in PyCharm is ../anaconda3/lib/python3.6 where is same from anaconda.</p>
  
  <p>Has anyone met this error before?</p>
  
  <p>Could anyone can help me to solve this error? </p>