PyLint “Unable to import” error – how to set PYTHONPATH?

There are two options I’m aware of. One, change the PYTHONPATH environment variable to include the directory above your module. Alternatively, edit ~/.pylintrc to include the directory above your module, like this: [MASTER] init-hook=’import sys; sys.path.append(“/path/to/root”)’ (Or in other version of pylint, the init-hook requires you to change [General] to [MASTER]) Both of these options … Read more

How to add to the PYTHONPATH in Windows, so it finds my modules/packages?

You know what has worked for me really well on windows. My Computer > Properties > Advanced System Settings > Environment Variables > Just add the path as C:\Python27 (or wherever you installed python) OR Then under system variables I create a new Variable called PythonPath. In this variable I have C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\other-folders-on-the-path This is the … Read more