Unable to import matplotlib in PyDev

后端 未结 3 870
执笔经年
执笔经年 2021-01-26 08:29

I am using Ubuntu 10.04 and have successfully configured PyDev to work with Python and have written a few simple example projects. Now I am trying to incorporate numpy and matpl

相关标签:
3条回答
  • 2021-01-26 08:41

    I added numpy to the Forced Builtins and worked like charm.

    0 讨论(0)
  • 2021-01-26 08:51

    Sounds like the interpreter you setup for Pydev is not pointing to the appropriate version of python (that you've install mpl and np). In the terminal, it's likely the effect of typing python is tantamount to env python; pydev might not be using this interpreter.

    But, if the pydev interpreter is pointed to the right location, you might simply have to rehash the interpreter (basically, set it up again) to have mpl show up.

    You could try this in the terminal and see if the results are different:

    python -c 'import platform; print platform.python_version()'

    ${PYTHONPATH}/python -c 'import platform; print platform.python_version()'

    0 讨论(0)
  • 2021-01-26 09:03

    Right click your project, then go to properties, then click PyDev - Interpreter/Grammar, click "Click here to configure an interpreter not listed". Then select the interpreter you are using, click Install/Uninstall with pip, then enter matplotlib for . Then restart Eclipse and it should work.

    0 讨论(0)
提交回复
热议问题