If I'm in a virtual environment for Python 2, tern_for_vim will use urllib from the system's site packages (potentially Python 3), while attempting to access http from the virtual environment's pats.
Error detected while processing /Users/me/.dot-config/.vim/plugged/tern_for_vim/autoload/tern.vim:
line 9:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/me/.dot-config/.vim/plugged/tern_for_vim/script/tern.py", line 8, in <module>
from urllib import request
File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 88, in <module>
import http.client
File "snip/.venv/lib/python2.7/site-packages/http/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
To recreate this, have Python 3 as default system interpreter, then Python 2 as a virtual environment. And be inside the virtual environment. And python-mode/python-mode.
Then open a Python file. Then try to open any JS file.
This plugin use Vim's Python integration feature.
So if you want to use python 2 to run the script.
Vim most have +python flag.
Your vim is using +python3, not +python.
3cffc28
If I'm in a virtual environment for Python 2, tern_for_vim will use urllib from the system's site packages (potentially Python 3), while attempting to access http from the virtual environment's pats.
To recreate this, have Python 3 as default system interpreter, then Python 2 as a virtual environment. And be inside the virtual environment. And python-mode/python-mode.
Then open a Python file. Then try to open any JS file.
venv:
system python 3
Expected behavior: tern_for_js should be using the same site-packages (one way or another)
I'm not quite sure how this is happening. It may have to do with having vim installed with +python3.