You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error loading the plugin when there is a python file in directory whose name clashes with the dependencies #1156
Hi, I was getting the Error detected while processing .../pymode/lint.vim, and looked at the troubleshooting steps which did not resolve the issue (rightfully so); so I looked into the root cause a bit. I realized that, in this case (which, I believe can happen to many), the call from pylama.lint.extensions import LINTERS that pymode/lint.vim does eventually tries to load a python module named "io". However, there is a file named as io.py in the directory I am calling vim from, so the names for the modules clash, and I get an error. Is there a way to setup pymode or vim so that it is robust to this edge case? Thank you very much!
It's related to pythonpath and fixing it on a side of python-mode is near impossible or would include some hardcore hacking in form of adding/removing stuff to sys.path and etc).
But there is probably an easy fix for you, relative import: from . import io will fix it, that is the reason why it's recommended to perform 'import X.Y' only on stdlib modules.
An alternative solution for you would be to use flags of interpret like perhaps: python -P app.py or python -I app.py, this however I doubt would help you or would introduce tons of other issues.
Activity
Drachenfels commentedon Feb 17, 2023
It's related to pythonpath and fixing it on a side of python-mode is near impossible or would include some hardcore hacking in form of adding/removing stuff to sys.path and etc).
But there is probably an easy fix for you, relative import:
from . import iowill fix it, that is the reason why it's recommended to perform 'import X.Y' only on stdlib modules.An alternative solution for you would be to use flags of interpret like perhaps:
python -P app.pyorpython -I app.py, this however I doubt would help you or would introduce tons of other issues.