If you're using a virtualenv, just double-check that the Python version of your virtualenv is the same as the one on the web tab.We're starting to migrate to lmod to manage dependencies.Here's the helper module that I'm currently using to work around this, which attempts to prevent a variety of path-related mistakes (like accidentally unloading system Python directories that also ended up on PYTHONPATH, or failing due to duplicate entries to PYTHONPATH): ''' Helper module to support modifying PYTHONPATH via lmod ''' import logging import os import sys from env_modules_python import module as lmod_module logger = Logger(__name__) def split_path(): ''' Split into the current, system, and pythonpath components ''' # Just the current executable.exec_path = sys.path[0:1] # Assume that the current PYTHONPATH component of the is # already up to date with the PYTHONPATH environment variable.This can result in crashes, or worse, importing an incorrect version of a Python module.Unfortunately, there's no provided way in Python to recalculate .
At the bottom of this window, there is an icon for “Add Path”. Now you can find the directory you want to add, as if you were opening a file. Once you have selected a directory, it will become a permanent addition to Python’s paths within Spyder. I have a project with 2 content roots, if I import form one to the other and run a script I get a Import Error: No module named.I had this problem with the plugin as well, I set up two modules and had one depend on the other and I still got a Import Error.So If this shows any errors and won't even load python (eg syntax errors), you'll need to fix them.If it loads OK, it will drop you into a Python shell. Then, check whether they really are coming from where you think they are: In Django, we sometimes don't import modules directly in the WSGI file, but we do specify a dot-notation import path to the settings in an environment variable.Even though it is quite a short function, I am quite distressed by how fragrantly the DRY principle is being violated by this approach, and would love to find a way to keep the modification logic in one place. Note:- One thing that springs to mind is to install the modifying logic into a common location that is always on PYTHONPATH.