Installing Pip on Msys
Asked Answered
H

3

16

I have built a simple PyGTK app using Python 3.5.2 and Msys but I need some modules not in the default installation, and although I could use setup.py install to get them I would much rather use pip.

I looked around and found this but it relates to Python 2 and gave an error when attempting to follow the instructions given:

$ python3 getpip.py

Collecting pip
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
Collecting setuptools
  Using cached setuptools-38.2.5-py2.py3-none-any.whl
Collecting wheel
  Using cached wheel-0.30.0-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel
Exception:
Traceback (most recent call last):
  File "C:\Users\Simon\AppData\Local\Temp\tmpoumuod3r\pip.zip\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\Simon\AppData\Local\Temp\tmpoumuod3r\pip.zip\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "C:\Users\Simon\AppData\Local\Temp\tmpoumuod3r\pip.zip\pip\req\req_set.py", line 784, in install
    **kwargs
  File "C:\Users\Simon\AppData\Local\Temp\tmpoumuod3r\pip.zip\pip\req\req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "C:\Users\Simon\AppData\Local\Temp\tmpoumuod3r\pip.zip\pip\req\req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "C:\Users\Simon\AppData\Local\Temp\tmpoumuod3r\pip.zip\pip\wheel.py", line 462, in move_wheel_files
    generated.extend(maker.make(spec))
  File "C:\Users\Simon\AppData\Local\Temp\tmpoumuod3r\pip.zip\pip\_vendor\distlib\scripts.py", line 372, in make
    self._make_script(entry, filenames, options=options)
  File "C:\Users\Simon\AppData\Local\Temp\tmpoumuod3r\pip.zip\pip\_vendor\distlib\scripts.py", line 276, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "C:\Users\Simon\AppData\Local\Temp\tmpoumuod3r\pip.zip\pip\_vendor\distlib\scripts.py", line 212, in _write_script
    launcher = self._get_launcher('t')
  File "C:\Users\Simon\AppData\Local\Temp\tmpoumuod3r\pip.zip\pip\_vendor\distlib\scripts.py", line 351, in _get_launcher
    result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'

and I tried the way one would install pip on Linux:

pacman -S python2-pip           
pacman -S python-pip           

as listed here, as well as:

pacman -S python3-pip

but each time I got a error: target not found: error.

Surprisingly I couldn't find anything else.

So how do I get pip on Msys?

Thanks.

Headmost answered 4/1, 2018 at 0:16 Comment(2)
FYI github.com/Alexpux/MSYS2-packages/issues/889Collective
@Collective I know it doesn't come with pip and that page confirms it. I to know if there is a way to install it separately.Headmost
E
51

Please note that at this time the following command is now working on msys2:

$ pacman -S python3-pip
$ pip3 install --upgrade pip
Eddra answered 27/4, 2018 at 23:38 Comment(3)
You are right. I recently updated my MSYS2 installation and this worked a treat, thank you :)Headmost
This is working, but installs a new Python executable, without the GTK libraries. How can I have both GTK and Pip with the same Python executable?Na
Installing through pacman and then upgrading through pip is a bad advice; the later effectively corrupts the pacman pip package, causing future pacman -Syu to fail (if the pip was actually updated). Instead, either stick to using the version from pacman, or install pip entirely without pacman (see other answers).\Gourami
N
7

The accepted answer installs a new Python exectuable with pip, but without GTK support.

In order to install pip support to the existing GTK Python executable, after encountering that error, we need to run:

python -m pip install -U --force-reinstall pip

(taken from this issue)

To summarize the steps required to install Pip support to the GTK-Python executable:

  1. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  2. python get-pip.py
  3. (ignore the error from previous step)
  4. python -m pip install -U --force-reinstall pip
Na answered 28/10, 2019 at 15:14 Comment(0)
C
2

To install pip, securely download get-pip.py.

Then run the following:

python get-pip.py

For more details refer: https://pip.pypa.io/en/stable/installing/

Condense answered 9/4, 2018 at 16:44 Comment(2)
OP is already using getpip.py, and Python 3 seems to be a requirement. I'm not sure your copy/paste is helping here :/Album
In msys2, the pip is not installed as part of the default packages when python is installed (The version of python installed is 3.6.2). Installation using the pacman did not yield any result was getting error: target not found: error. So downloaded the file manually from location to install pip (9.0.3).Condense

© 2022 - 2024 — McMap. All rights reserved.