Python matplotlib - ImportError: No module named functools_lru_cache












1















I have installed matplotlib for Python using pip which was completed without error. Yet I get this error when I try to import it:



import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/__init__.py", line 131, in <module>
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 29, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/fontconfig_pattern.py", line 28, in <module>
from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache









share|improve this question

























  • "functools_lru_cache.py" : Install python-backports.functools-lru-cache packages.ubuntu.com/…

    – Knud Larsen
    Jun 14 '18 at 15:29
















1















I have installed matplotlib for Python using pip which was completed without error. Yet I get this error when I try to import it:



import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/__init__.py", line 131, in <module>
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 29, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/fontconfig_pattern.py", line 28, in <module>
from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache









share|improve this question

























  • "functools_lru_cache.py" : Install python-backports.functools-lru-cache packages.ubuntu.com/…

    – Knud Larsen
    Jun 14 '18 at 15:29














1












1








1








I have installed matplotlib for Python using pip which was completed without error. Yet I get this error when I try to import it:



import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/__init__.py", line 131, in <module>
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 29, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/fontconfig_pattern.py", line 28, in <module>
from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache









share|improve this question
















I have installed matplotlib for Python using pip which was completed without error. Yet I get this error when I try to import it:



import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/__init__.py", line 131, in <module>
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 29, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/fontconfig_pattern.py", line 28, in <module>
from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache






python pip matplotlib






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 14 '18 at 14:07









Byte Commander

63.3k26171289




63.3k26171289










asked Jun 14 '18 at 14:02









r kr k

62




62













  • "functools_lru_cache.py" : Install python-backports.functools-lru-cache packages.ubuntu.com/…

    – Knud Larsen
    Jun 14 '18 at 15:29



















  • "functools_lru_cache.py" : Install python-backports.functools-lru-cache packages.ubuntu.com/…

    – Knud Larsen
    Jun 14 '18 at 15:29

















"functools_lru_cache.py" : Install python-backports.functools-lru-cache packages.ubuntu.com/…

– Knud Larsen
Jun 14 '18 at 15:29





"functools_lru_cache.py" : Install python-backports.functools-lru-cache packages.ubuntu.com/…

– Knud Larsen
Jun 14 '18 at 15:29










2 Answers
2






active

oldest

votes


















1














Uninstall first



pip uninstall backports.functools_lru_cache


and then re-install it



pip install backports.functools_lru_cache


like described in this answer.






share|improve this answer

































    0














    try this I had same problem this morning



    sudo apt-get install python-matplotlib


    I also am using python3.7
    a little later after I installed a few modules. I ran.



    pip3 install matplotlib


    I can now import matplotlib.






    share|improve this answer

























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1046554%2fpython-matplotlib-importerror-no-module-named-functools-lru-cache%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      Uninstall first



      pip uninstall backports.functools_lru_cache


      and then re-install it



      pip install backports.functools_lru_cache


      like described in this answer.






      share|improve this answer






























        1














        Uninstall first



        pip uninstall backports.functools_lru_cache


        and then re-install it



        pip install backports.functools_lru_cache


        like described in this answer.






        share|improve this answer




























          1












          1








          1







          Uninstall first



          pip uninstall backports.functools_lru_cache


          and then re-install it



          pip install backports.functools_lru_cache


          like described in this answer.






          share|improve this answer















          Uninstall first



          pip uninstall backports.functools_lru_cache


          and then re-install it



          pip install backports.functools_lru_cache


          like described in this answer.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 2 at 23:01









          zx485

          1,45231114




          1,45231114










          answered Jan 2 at 22:14









          Jirka B.Jirka B.

          112




          112

























              0














              try this I had same problem this morning



              sudo apt-get install python-matplotlib


              I also am using python3.7
              a little later after I installed a few modules. I ran.



              pip3 install matplotlib


              I can now import matplotlib.






              share|improve this answer






























                0














                try this I had same problem this morning



                sudo apt-get install python-matplotlib


                I also am using python3.7
                a little later after I installed a few modules. I ran.



                pip3 install matplotlib


                I can now import matplotlib.






                share|improve this answer




























                  0












                  0








                  0







                  try this I had same problem this morning



                  sudo apt-get install python-matplotlib


                  I also am using python3.7
                  a little later after I installed a few modules. I ran.



                  pip3 install matplotlib


                  I can now import matplotlib.






                  share|improve this answer















                  try this I had same problem this morning



                  sudo apt-get install python-matplotlib


                  I also am using python3.7
                  a little later after I installed a few modules. I ran.



                  pip3 install matplotlib


                  I can now import matplotlib.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jun 18 '18 at 17:58









                  trietend

                  1928




                  1928










                  answered Jun 18 '18 at 17:26









                  plutesciplutesci

                  4714




                  4714






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1046554%2fpython-matplotlib-importerror-no-module-named-functools-lru-cache%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      張江高科駅