title: How to tell Python to use 'pip3' if 'pip' isn't available?
body: <p>I'm trying to build a website maker in Python, and it works - up until I decided to put sound effects, which requires <code>playsound</code>. After searching StackOverflow for autoinstalling libraries I found my answer and popped it into <code>setup.py</code>. I then ran the code in Windows to check it worked - it did, but then I remembered that macOS and Linux (in my experience) can't use <code>pip</code>, they only use <code>pip3</code>. So I wrote an except into the setup file so whenever <code>ModuleNotFoundError</code> popped up during the <code>pip</code> sequence it would use <code>pip3</code> instead. However, all I got (in Ubuntu) was this:</p>
  <pre><code>bye@DESKTOP-L5UUI0C:/mnt/f/pythonexperements/webmaker$ python3 1.py
   __          __  _         _ _         __  __       _
   \ \......../ / | |.......(_| |.......|  \/  |.....| |..............
   .\ \../\../ _..| |__  ___ _| |_ ___..| \  / |.__ _| |._____ _ __ ..
   ..\ \/  \/ / _ | '_ \/ __| | __/ _ \.| |\/| |/ _` | |/ / _ | '__|..
   ...\  /\  |  __| |_) \__ | | ||  __/.| |..| | (_| |   |  __| |.....
   ....\/..\/.\___|_.__/|___|_|\__\___|.|_|..|_|\__,_|_|\_\___|_|.....
                                                        by ByeMC; v1.0
  
  Installing required libraries, installing &quot;playsound&quot;
  Traceback (most recent call last):
    File &quot;1.py&quot;, line 13, in &lt;module&gt;
      from playsound import playsound
  ModuleNotFoundError: No module named 'playsound'
  
  During handling of the above exception, another exception occurred: # this is exactly what the terminal produced, please don't edit this line
  
  Traceback (most recent call last):
    File &quot;1.py&quot;, line 16, in &lt;module&gt;
      import setup
    File &quot;/mnt/f/pythonexperements/webmaker/setup.py&quot;, line 3, in &lt;module&gt;
      import pip
  ModuleNotFoundError: No module named 'pip'
  </code></pre>
  <p>The main script for the program:</p>
  <pre class="lang-py prettyprint-override"><code>[...]
  print(asciiart)
  
  try:
      from playsound import playsound
  except ModuleNotFoundError:
      print('Installing required libraries, installing &quot;playsound&quot;')
      import setup
      install('playsound')
      print('Install done')
  
  
  playsound('notif')
  [...]
  </code></pre>
  <p>The code that autoinstalls the libraries:</p>
  <pre class="lang-py prettyprint-override"><code># Setup files
  
  import pip
  
  depend = ['playsound']
  
  def install(package):
      import importlib
      try:
          importlib.import_module(package)
      except ImportError:
          try:
              import pip
              pip.main(['install', package])
          except ModuleNotFoundError:
              import pip3
              pip3.main(['install', package])
      finally:
          globals()[package] = importlib.import_module(package)
  
  
  for x in depend:
      install(x)
  </code></pre>
  <p>I would love if you could help me.</p>