How to add python library to Spyder

131 views
Skip to first unread message

Amine Aboufirass

unread,
Apr 28, 2017, 1:34:33 PM4/28/17
to spyder
I am trying to add an external python library from a third party software into Spyder so I can work with it. I have already tried the following:

 - Adding library path containing .py files to Tools>PYTHONPATH manager
 - Synchronizing the path
 - Updating module names list through Tools>Update Module names list

However, when I try to import modules from this library I get two types of errors:

    import easy
    Traceback (most recent call last):
    
      File "<ipython-input-2-685519d35f15>", line 1, in <module>
        import easy
    
      File "C:\Program Files (x86)\Plaxis\PLAXIS 2D\plxscripting\easy.py", line 24, in <module>
        from .server import Server, InputProcessor

ValueError: Attempted relative import in non-package


The second type of error as follows:

    from plxscripting.easy import *
    Traceback (most recent call last):
    
      File "<ipython-input-1-a40c101d3bb0>", line 1, in <module>
        from plxscripting.easy import *
    
    ImportError: No module named plxscripting.easy

I don't understand why Spyder is not recognizing these libraries. The path has been added and shows up on the manager. What constitutes a python module? Is it not just  the .py file with module name prefix? Is not the path sufficient to work with the library through the IDE?

Reply all
Reply to author
Forward
0 new messages