title: Install via pacman to specific version of Python
body: <p>The default Python version for MSYS2 seems to be 3.8. I need to use 3.7 at the moment because I have to use PyInstaller and it is not currently compatible with 3.8 in MSYS2. I can download the earlier version of Python from <a href="http://repo.msys2.org/" rel="nofollow noreferrer">http://repo.msys2.org/</a> and install it using pacman. With a fresh install of MSYS2 I run the following commands:</p>
  <pre><code>pacman -S glib2-devel
  pacman -U python-3.7.4-1-x86_64.pkg.tar.xz
  pacman -S python-pip
  pacman -S python-setuptools
  </code></pre>
  <p>If I try to run a python script I am met with an error:</p>
  <pre><code>  File &quot;setup.py&quot;, line 15, in &lt;module&gt;
      from setuptools import setup
  ModuleNotFoundError: No module named 'setuptools'
  </code></pre>
  <p>This is due to the fact that everything installed after Python is actually installing in the default Python 3.8 location rather than 3.7:</p>
  <pre><code>C:\msys64\usr\lib\python3.8\site-packages
  </code></pre>
  <p>If I copy and paste the contents of site-packages into Python 3.7 and then try running a script I get the error:</p>
  <pre><code>  File &quot;setup.py&quot;, line 15, in &lt;module&gt;
      from setuptools import setup
    File &quot;/usr/lib/python3.7/site-packages/setuptools/__init__.py&quot;, line 19, in &lt;module&gt;
      from setuptools.dist import Distribution
    File &quot;/usr/lib/python3.7/site-packages/setuptools/dist.py&quot;, line 34, in &lt;module&gt;
      from setuptools import windows_support
    File &quot;/usr/lib/python3.7/site-packages/setuptools/windows_support.py&quot;, line 2, in &lt;module&gt;
      import ctypes
    File &quot;/usr/lib/python3.7/ctypes/__init__.py&quot;, line 7, in &lt;module&gt;
      from _ctypes import Union, Structure, Array
  ImportError: No such file or directory
  </code></pre>
  <p>Which is supposed to be resolved via <code>libffi</code>, which was installed prior to Python, but likely does not go to a location that 3.7 can recognize?</p>
  <p>Is there a way to set a specific version of Python as the default in MSYS2? Perhaps a path that can be set in the .bashrc file? I tried to set PYTHONPATH in there to Python 3.7 but it didn't make a difference as to where the packages ended up being installed to.</p>