I have Python 3.6 installed on my Windows computer. I installed the Windows Subsystem for Linux (WSL). When I type python
into my Ubuntu terminal, I'm told I'm using Python 2.7 (which I imagine comes pre-installed on Ubuntu).
How can I use the same Python for both Windows and Linux, so that if I install a new package with pip from either, I can access it from either? I want the two systems to share the same Python.
It seems as though following something along the lines of creating an alias might work, but I'm pretty sure the pip
command will remain the same (referring to Python 3.6 on Windows and Python 2.7 on Linux), as might other functionality.
python
), and to use the python 3.6.x interpreter you usepython3
– guiverc Jun 08 '18 at 06:53pip
and it does Python3 stuff, whereas on Linux, if I dopip3
it says it's not installed. – Pro Q Jun 08 '18 at 06:55pip3
indeed may be non default package, in which case you may need to install it viasudo apt-get install pip3
orpython3-pip
. No on laptop, hence can't suggest the exact package of the top of my mind, bit that's the general form for Python 3 packages in Ubuntu and Debian repositories. In general, I'd suggest familiazing withapt
utility, as a lot of Python packages on pypi are also available in Ubuntu official repositories. – Sergiy Kolodyazhnyy Jun 08 '18 at 07:09pip3 freeze
will I get the same output as doingpip freeze
on Windows Terminal? I would like to get the same output. I'm fairly familiar with Ubuntu and installing software, I'd just like to make sure I'm not duplicating things and confusing myself :P – Pro Q Jun 08 '18 at 07:12pip
on Windows as you say refers to Python 3.6 version andpip3
on Ubuntu to the same version, it's logical to assume they'll be the same. If you're generatingrequirements
file, just beware that on Windows line endings in text files are different than on Linux, hence you may need to usedos2unix
utility to convert them. Otherwise, I don't think there's any need to worry. Consider checking whether some packages may be Windows-specific also. – Sergiy Kolodyazhnyy Jun 08 '18 at 07:20Python3
on Ubuntu tells me I'm running Python 3.5. RunningPython
on Windows tells me I'm running Python 3.6. I think they're completely different versions. Still trying to figure out how to use one on the other or merge them in some way. – Pro Q Jun 08 '18 at 22:33