1

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?

user32882
  • 5,094
  • 5
  • 43
  • 82
  • Use tools !pip install packagename or https://stackoverflow.com/questions/10729116/adding-a-module-specifically-pymorph-to-spyder-python-ide – Guest TG Mar 14 '18 at 12:11
  • 1
    Use [PyCharm](https://www.jetbrains.com/pycharm/) and use python.exe coming with Plaxis as the interpreter of your project. I realize that it is not a Spyder solution but at least you can avoid the SciTE IDE coming with Plaxis. – rozsasarpi Aug 03 '18 at 16:19

0 Answers0