Spyder not importing basemap [duplicate]











up vote
0
down vote

favorite













This question already has an answer here:




  • Basemap import error in PyCharm —— KeyError: 'PROJ_LIB'

    4 answers



  • Basemap library using Anaconda Jupyter Notebooks - KeyError: PROJ_LIB

    2 answers




I have trouble to execute netCDF file and get error in spyder. Here is what I get when I run the test.py script:



runfile('C:/Users/WINDOWS 8/Desktop/Testpython/test1.py', wdir='C:/Users/WINDOWS 8/Desktop/Testpython')
Traceback (most recent call last):

File "<ipython-input-1-c58f888280ee>", line 1, in <module>
runfile('C:/Users/WINDOWS 8/Desktop/Testpython/test1.py', wdir='C:/Users/WINDOWS 8/Desktop/Testpython')

File "C:ProgramDataAnaconda2libsite-packagesspyder_kernelscustomizespydercustomize.py", line 668, in runfile
execfile(filename, namespace)

File "C:ProgramDataAnaconda2libsite-packagesspyder_kernelscustomizespydercustomize.py", line 93, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Users/WINDOWS 8/Desktop/Testpython/test1.py", line 3, in <module>
from mpl_toolkits.basemap import Basemap

File "C:ProgramDataAnaconda2libsite-packagesmpl_toolkitsbasemap__init__.py", line 155, in <module>
pyproj_datadir = os.environ['PROJ_LIB']

File "C:ProgramDataAnaconda2libos.py", line 425, in __getitem__
return self.data[key.upper()]
KeyError: 'PROJ_LIB'


I tried to uninstall an reinstall basemap from source, from apt-get, from conda, but it does not change anything: I can't import basemap.



Thank you for your help










share|improve this question













marked as duplicate by ImportanceOfBeingErnest matplotlib
Users with the  matplotlib badge can single-handedly close matplotlib questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 at 11:45


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















    up vote
    0
    down vote

    favorite













    This question already has an answer here:




    • Basemap import error in PyCharm —— KeyError: 'PROJ_LIB'

      4 answers



    • Basemap library using Anaconda Jupyter Notebooks - KeyError: PROJ_LIB

      2 answers




    I have trouble to execute netCDF file and get error in spyder. Here is what I get when I run the test.py script:



    runfile('C:/Users/WINDOWS 8/Desktop/Testpython/test1.py', wdir='C:/Users/WINDOWS 8/Desktop/Testpython')
    Traceback (most recent call last):

    File "<ipython-input-1-c58f888280ee>", line 1, in <module>
    runfile('C:/Users/WINDOWS 8/Desktop/Testpython/test1.py', wdir='C:/Users/WINDOWS 8/Desktop/Testpython')

    File "C:ProgramDataAnaconda2libsite-packagesspyder_kernelscustomizespydercustomize.py", line 668, in runfile
    execfile(filename, namespace)

    File "C:ProgramDataAnaconda2libsite-packagesspyder_kernelscustomizespydercustomize.py", line 93, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

    File "C:/Users/WINDOWS 8/Desktop/Testpython/test1.py", line 3, in <module>
    from mpl_toolkits.basemap import Basemap

    File "C:ProgramDataAnaconda2libsite-packagesmpl_toolkitsbasemap__init__.py", line 155, in <module>
    pyproj_datadir = os.environ['PROJ_LIB']

    File "C:ProgramDataAnaconda2libos.py", line 425, in __getitem__
    return self.data[key.upper()]
    KeyError: 'PROJ_LIB'


    I tried to uninstall an reinstall basemap from source, from apt-get, from conda, but it does not change anything: I can't import basemap.



    Thank you for your help










    share|improve this question













    marked as duplicate by ImportanceOfBeingErnest matplotlib
    Users with the  matplotlib badge can single-handedly close matplotlib questions as duplicates and reopen them as needed.

    StackExchange.ready(function() {
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function() {
    $hover.showInfoMessage('', {
    messageElement: $msg.clone().show(),
    transient: false,
    position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
    dismissable: false,
    relativeToBody: true
    });
    },
    function() {
    StackExchange.helpers.removeMessages();
    }
    );
    });
    });
    Nov 19 at 11:45


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite












      This question already has an answer here:




      • Basemap import error in PyCharm —— KeyError: 'PROJ_LIB'

        4 answers



      • Basemap library using Anaconda Jupyter Notebooks - KeyError: PROJ_LIB

        2 answers




      I have trouble to execute netCDF file and get error in spyder. Here is what I get when I run the test.py script:



      runfile('C:/Users/WINDOWS 8/Desktop/Testpython/test1.py', wdir='C:/Users/WINDOWS 8/Desktop/Testpython')
      Traceback (most recent call last):

      File "<ipython-input-1-c58f888280ee>", line 1, in <module>
      runfile('C:/Users/WINDOWS 8/Desktop/Testpython/test1.py', wdir='C:/Users/WINDOWS 8/Desktop/Testpython')

      File "C:ProgramDataAnaconda2libsite-packagesspyder_kernelscustomizespydercustomize.py", line 668, in runfile
      execfile(filename, namespace)

      File "C:ProgramDataAnaconda2libsite-packagesspyder_kernelscustomizespydercustomize.py", line 93, in execfile
      exec(compile(scripttext, filename, 'exec'), glob, loc)

      File "C:/Users/WINDOWS 8/Desktop/Testpython/test1.py", line 3, in <module>
      from mpl_toolkits.basemap import Basemap

      File "C:ProgramDataAnaconda2libsite-packagesmpl_toolkitsbasemap__init__.py", line 155, in <module>
      pyproj_datadir = os.environ['PROJ_LIB']

      File "C:ProgramDataAnaconda2libos.py", line 425, in __getitem__
      return self.data[key.upper()]
      KeyError: 'PROJ_LIB'


      I tried to uninstall an reinstall basemap from source, from apt-get, from conda, but it does not change anything: I can't import basemap.



      Thank you for your help










      share|improve this question














      This question already has an answer here:




      • Basemap import error in PyCharm —— KeyError: 'PROJ_LIB'

        4 answers



      • Basemap library using Anaconda Jupyter Notebooks - KeyError: PROJ_LIB

        2 answers




      I have trouble to execute netCDF file and get error in spyder. Here is what I get when I run the test.py script:



      runfile('C:/Users/WINDOWS 8/Desktop/Testpython/test1.py', wdir='C:/Users/WINDOWS 8/Desktop/Testpython')
      Traceback (most recent call last):

      File "<ipython-input-1-c58f888280ee>", line 1, in <module>
      runfile('C:/Users/WINDOWS 8/Desktop/Testpython/test1.py', wdir='C:/Users/WINDOWS 8/Desktop/Testpython')

      File "C:ProgramDataAnaconda2libsite-packagesspyder_kernelscustomizespydercustomize.py", line 668, in runfile
      execfile(filename, namespace)

      File "C:ProgramDataAnaconda2libsite-packagesspyder_kernelscustomizespydercustomize.py", line 93, in execfile
      exec(compile(scripttext, filename, 'exec'), glob, loc)

      File "C:/Users/WINDOWS 8/Desktop/Testpython/test1.py", line 3, in <module>
      from mpl_toolkits.basemap import Basemap

      File "C:ProgramDataAnaconda2libsite-packagesmpl_toolkitsbasemap__init__.py", line 155, in <module>
      pyproj_datadir = os.environ['PROJ_LIB']

      File "C:ProgramDataAnaconda2libos.py", line 425, in __getitem__
      return self.data[key.upper()]
      KeyError: 'PROJ_LIB'


      I tried to uninstall an reinstall basemap from source, from apt-get, from conda, but it does not change anything: I can't import basemap.



      Thank you for your help





      This question already has an answer here:




      • Basemap import error in PyCharm —— KeyError: 'PROJ_LIB'

        4 answers



      • Basemap library using Anaconda Jupyter Notebooks - KeyError: PROJ_LIB

        2 answers








      python matplotlib spyder matplotlib-basemap






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 19 at 7:14









      Adhitya WN

      1




      1




      marked as duplicate by ImportanceOfBeingErnest matplotlib
      Users with the  matplotlib badge can single-handedly close matplotlib questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Nov 19 at 11:45


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






      marked as duplicate by ImportanceOfBeingErnest matplotlib
      Users with the  matplotlib badge can single-handedly close matplotlib questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Nov 19 at 11:45


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          The error message looks to me related to the pyproj module. Do you have all basemap dependencies installed and up to date ? You can check it with this command (requires pip)



          pip install --upgrade --user matplotlib numpy pyproj pyshp OWSLib Pillow


          It is actually a conda-related issue, please see here.






          share|improve this answer























          • I did, but still not working. I don't know why....
            – Adhitya WN
            Nov 19 at 8:51










          • See the update in my answer.
            – Patol75
            Nov 19 at 8:58


















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          The error message looks to me related to the pyproj module. Do you have all basemap dependencies installed and up to date ? You can check it with this command (requires pip)



          pip install --upgrade --user matplotlib numpy pyproj pyshp OWSLib Pillow


          It is actually a conda-related issue, please see here.






          share|improve this answer























          • I did, but still not working. I don't know why....
            – Adhitya WN
            Nov 19 at 8:51










          • See the update in my answer.
            – Patol75
            Nov 19 at 8:58















          up vote
          0
          down vote













          The error message looks to me related to the pyproj module. Do you have all basemap dependencies installed and up to date ? You can check it with this command (requires pip)



          pip install --upgrade --user matplotlib numpy pyproj pyshp OWSLib Pillow


          It is actually a conda-related issue, please see here.






          share|improve this answer























          • I did, but still not working. I don't know why....
            – Adhitya WN
            Nov 19 at 8:51










          • See the update in my answer.
            – Patol75
            Nov 19 at 8:58













          up vote
          0
          down vote










          up vote
          0
          down vote









          The error message looks to me related to the pyproj module. Do you have all basemap dependencies installed and up to date ? You can check it with this command (requires pip)



          pip install --upgrade --user matplotlib numpy pyproj pyshp OWSLib Pillow


          It is actually a conda-related issue, please see here.






          share|improve this answer














          The error message looks to me related to the pyproj module. Do you have all basemap dependencies installed and up to date ? You can check it with this command (requires pip)



          pip install --upgrade --user matplotlib numpy pyproj pyshp OWSLib Pillow


          It is actually a conda-related issue, please see here.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 19 at 8:58

























          answered Nov 19 at 7:47









          Patol75

          6116




          6116












          • I did, but still not working. I don't know why....
            – Adhitya WN
            Nov 19 at 8:51










          • See the update in my answer.
            – Patol75
            Nov 19 at 8:58


















          • I did, but still not working. I don't know why....
            – Adhitya WN
            Nov 19 at 8:51










          • See the update in my answer.
            – Patol75
            Nov 19 at 8:58
















          I did, but still not working. I don't know why....
          – Adhitya WN
          Nov 19 at 8:51




          I did, but still not working. I don't know why....
          – Adhitya WN
          Nov 19 at 8:51












          See the update in my answer.
          – Patol75
          Nov 19 at 8:58




          See the update in my answer.
          – Patol75
          Nov 19 at 8:58



          Popular posts from this blog

          Costa Masnaga

          Fotorealismo

          Sidney Franklin