How To Fix Eclipse Pydev Interpreter Not Found Issue

I install an eclipse with the PyDev plugin on a new PC. After that when I import the existing python example project, it shows me an error message Interpreter: python-anaconda not found on the eclipse window left side Project Explorer panel. This article will tell you how to fix it.

eclipse pydev interpreter not found error

1. How To Fix Eclipse Pydev Interpreter Not Found Issue Steps.

  1. When we create a PyDev project in eclipse, it will create a project file in the PyDev project folder and the file name is .pydevproject.
  2. Below is the content of the eclipse PyDev project file ( .pydevproject ), the content data is XML format.
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <?eclipse-pydev version="1.0"?><pydev_project>
        
        <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
                                                                            
            <path>/${PROJECT_DIR_NAME}</path>
        
        </pydev_pathproperty>
                                           
        <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python interpreter</pydev_property>
                                        
        <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">python-anaconda</pydev_property>
    
        <pydev_pathproperty name="org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH">
             
            <path>C:\Users\zhaosong\anaconda3\envs\python_example\Lib\site-packages</path>
            <path>C:\Users\zhaosong\anaconda3\DLLs</path>
        </pydev_pathproperty>
        
    </pydev_project>
    
  3. From the above XML content, we can see that the project used python interpreter name is python-anaconda.
    <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">python-anaconda</pydev_property>
  4. And this python interpreter does not exist in the current eclipse PyDev project.
  5. So to fix this issue, what we should do is to change the eclipse PyDev project to use another existing python interpreter.
  6. Open eclipse, select the Pydev project on the eclipse window left side Project Explorer panel.
  7. Click the Project —-> Properties menu item on the eclipse top menu bar.
  8. Click the PyDev —> Interpreter/Grammar menu item in the Pydev project properties window left side.
  9. Then you can choose the Pydev project used python interpreter on the window right side Interpreter drop-down list.
  10. You can read the article How To Change Python Interpreter In Eclipse Pydev Project To Use Different Python Virtual Environment Library to learn more.
  11. Now when you open the eclipse Pydev project’s .pydevproject file again, you will find the project used python interpreter has been changed to your select.
    <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">python</pydev_property>

2. How To Fix The Invalid External Source Folder Specified Error.

  1. Now after you restart your eclipse, you can find the above error has been fixed.
  2. But you may encounter another error, which error message like below.
    Invalid external source folder specified: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
  3. Open the PyDev project’s .pydevproject file again.
  4. Search org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH to find the below XML item and its value.
    <pydev_pathproperty name="org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH">
        <path>/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages</path>
    </pydev_pathproperty>
  5. You can see the pydev_pathproperty‘s value is not correct. You should get the correct value for the org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH property.
  6. Click the Window —> Preferences menu item on the Eclipse top menu bar to open the Preferences window.
  7. Click to expand the PyDev —> Interpreters —> Python Interpreter item on the Preferences window left side.
  8. Then you can see the python interpreter on the window right side Python Interpreters list.
  9. Find your python interpreter saved folder, in my environment, it is C:\Users\zhaosong\anaconda3.
  10. And then go to the above folder to find your environment org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH property’s value ( for example: C:\Users\zhaosong\anaconda3\Lib\site-packages).
  11. Use this value to replace the current org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH property’s value in the .pydevproject file.
  12. Now restart Eclipse again, the error will disappear.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.