Search code examples
pythoneclipseidepydev

How to add python "libraries" to Eclypse and pydev


I am trying to learn how to use Abaqus Scripting. I just downloaded Eclipse and added the pydev plugin. Everything seems to work fine.

What I want to do now is to add all the built-in Abaqus libraries or modules.

  • I would like, for example, the IDE to display the class members and methods when I press the ".".

  • I would like to see if the code compiles fine without running it into Abaqus.

How can I do this in Eclipse? Or should I change IDE? Or is it not possible?


I just tried, but no success, I don't fully understand what I need to do. I am very much a beginner at Python (today is my second day). I have in the abaqus folder the python folder. It leads to two subfolders:

  • -lib: full of .pyc file (I guess precompiled Python files)

  • -obj: full of windows dll and the python.exe which I guess is the interpeter.

I also tried to add this interpreter but Eclipse said it can not add it (Error getting info on the interpreter)

I just added the whole lib and obj folder. Maybe once I get more involved in Python I can give you more detailed explanations.


New information:

When I try to run the script it says:

ImportError: Bad magic number in C:\SIMULIA\Abaqus\6.9-1\Python\Lib\abaqus.pyc 

Is there a compatibility problem, maybe with different versions of the Python interpreters?


Solution

  • You can add these libraries to the settings to get the effect you want. This can be done in the Libraries setting accessed through Window > Preferences > PyDev > Interpreter - Python > Libraries. Add the .egg or source folder of the libraries you want to add and click Apply followed by OK.