在Msys上安装Pip

Sim*_*mon 10 python pip msys python-3.x

我使用Python 3.5.2和Msys构建了一个简单的PyGTK应用程序,但我需要一些不在默认安装中的模块,虽然我可以使用它setup.py install来获取它们,但我更愿意使用它们pip.

我环顾四周找到了这个,但它与Python 2有关,并在尝试按照给出的指示时发出错误:

$ 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'
Run Code Online (Sandbox Code Playgroud)

我尝试了pip在Linux上安装的方式:

pacman -S python2-pip           
pacman -S python-pip           
Run Code Online (Sandbox Code Playgroud)

由于上市这里,还有:

pacman -S python3-pip
Run Code Online (Sandbox Code Playgroud)

但每次我收到error: target not found:错误.

令人惊讶的是我找不到任何其他东西.

那么我如何pip上Msys?

谢谢.

use*_*167 27

请注意,此时以下命令现在正在msys2上运行:

$ pacman -S python3-pip
$ pip3 install --upgrade pip
Run Code Online (Sandbox Code Playgroud)

  • 你是对的.我最近更新了我的MSYS2安装,这有点好吃,谢谢:) (2认同)

Zvi*_*ika 7

接受的答案安装了一个新的 Python 可执行文件pip,但没有 GTK 支持。

为了安装pip对现有 GTK Python 可执行文件的支持,在遇到该错误后,我们需要运行:

python -m pip install -U --force-reinstall pip
Run Code Online (Sandbox Code Playgroud)

(摘自本期

总结将 Pip 支持安装到 GTK-Python 可执行文件所需的步骤:

  1. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  2. python get-pip.py
  3. (忽略上一步的错误)
  4. python -m pip install -U --force-reinstall pip