0

I am on a windows laptop but I use the ubuntu terminal alongside windows PowerShell. When I first started writing python code I had 0 idea what I was doing (and still don't, I now am just aware how little I know) and now I have ended up with the problem that I have two different places where python has installed modules, one where ubuntu goes and one where windows PowerShell goes.

The path for windows is: c:\users\panagiotifatouros\appdata\local\programs\python\python38\lib\site-packages

Whereas for ubuntu is it: /home/panagiotisfatouros/.local/lib/python3.8/site-packages

This is causing a great deal of difficulty with installing modules now such as the radian software for R where I can run it from the powershell installation but not the ubuntu one.

Is there anyway I can get ubuntu and powershell to use the same directory for all the python uses? (Preferably ubuntu would move to using the powershell directory because it works the best).

Also I am not sure if this is relevant but whenever using ubuntu I write pip3 but for windows powershell I write pip.

  • Is there a particular reason you need both? If you use both, you could alias python so that you can differentiate the two. Similar to how you use `pip3` vs `pip`. – Ghoti Jul 23 '21 at 12:47
  • Treat Ubuntu as a totally different pc and install everything you need on both independently as you need them – TERMINATOR Jul 23 '21 at 12:50
  • @Ghoti No I don't need to use both I would prefer to only have one but from Terminator's answer that apparently may not be possible? – Panagiotis Fatouros Jul 23 '21 at 12:55
  • You can remove one. I personally find Windows power shell to be difficult to use and would recommend removing the windows python installation. https://stackoverflow.com/questions/3515673/how-to-completely-remove-python-from-a-windows-machine – Ghoti Jul 23 '21 at 12:59

1 Answers1

0

You don't need to install Ubuntu Terminal on Windows. From development and learning point of perspective you can pretty much do anything you need to do on Powershell and command prompt. Keeping two entirely different terminals of two entirely different OS will make it even tougher going forward.

For your use case:

You can simply install Python libraries from this link https://www.python.org/ftp/python/3.9.6/python-3.9.6-amd64.exe Open the setup and check Add Python to PATH and click on Install Now. It will install python using default variables and set the PATH automatically, if not you can add the path similar to the following to Environment variables in Advanced settings in Windows settings. Its path will be like:

C:\Users\Username\AppData\Local\Programs\Python\Python36-32

You can check python version on your system using:

  • python -v

For various libraries you can install pip using:

  • py get-pip.py

For subsequent libraries you can simply run following on command prompt or Powershell:

  • For pandas, hit : " pip install pandas "

  • For numpy, hit : " pip install numpy "

psybrg
  • 689
  • 5
  • 7