Home:ALL Converter>How to make Sublime's python interpreter work when Sublime's on Windows and Python is on Ubuntu

How to make Sublime's python interpreter work when Sublime's on Windows and Python is on Ubuntu

Ask Time:2019-07-18T16:28:17         Author:Max Sfnv

Json Formatter

I am running Ubuntu on Windows (I can't change it). I use Sublime Test 3 as my code editor. I have Python installed on Ubuntu and I know the path to it from within Windows. Sublime's Python interpreter is not working when I run it. I would like to be able to do both of the following: a) Run basic Python commands in Sublime Text 3 on Windows using Python installed in Ubuntu folders b) Run Python modules in Sublime Text 3 on Windows using modules installed in Ubuntu folders

I have already tried adding the path to Python's Ubuntu folders to the PATH environment variable (for user, not for system). I didn't work. Then I installed Anaconda Python distribution on Windows, and added its path to the PATH variable (for user again). It did work. However, it means having to maintain two Pythons - one on Windows and one on Ubuntu, which defeats the purpose of my search. Also, I only managed to make it work for basic Python, and not for libraries. Adding PYTHONPATH variable with the path to Anaconda's modules on Windows broke the import of numpy and other libraries.

Just to clarify, I do not use Anaconda distribution, I was just trying all I could.

Author:Max Sfnv,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/57090203/how-to-make-sublimes-python-interpreter-work-when-sublimes-on-windows-and-pyth
yy