0

我正在编写一个需要 pygame 的项目。

我按照 pygame wiki 的说明在 python 中安装了 pygame。

pip install hg+http://bitbucket.org/pygame/pygame

我想将 pygame 添加到我正在创建的 wheel 目录中。我正在尝试使用命令执行此操作

pip wheel --wheel-dir=wheels/linux64 pygame

我尝试添加--no-index, --find-links=https://bitbucket.org/pygame/pygame, --allow-unverified pygame,--allow-external pygame选项。

输出总是类似于找不到满足 pygame 要求的包。

Downloading/unpacking pygame
  Could not find any downloads that satisfy the requirement pygame
  Some externally hosted files were ignored (use --allow-external pygame to allow).
Cleaning up...
No distributions at all found for pygame
Storing debug log for failure in /home/eric/.pip/pip.log

我怎样才能轮到我的本地版本的 pygame 并将其添加到我的轮子目录中?

4

1 回答 1

2

您需要将 pip 指向源目录才能制作轮子。例如:

$ hg clone https://bitbucket.org/pygame/pygame
...
...
$ pip wheel pygame/
Processing ./pygame
Building wheels for collected packages: pygame
  Running setup.py bdist_wheel for pygame
  Stored in directory: /home/vagrant/wheelhouse
Successfully built pygame
(test)vagrant@vagrant-ubuntu-trusty-64:~$ ll /home/vagrant/wheelhouse
total 3264
drwxrwxr-x 2 vagrant vagrant    4096 Sep  6 01:24 ./
drwxr-xr-x 7 vagrant vagrant    4096 Sep  6 01:24 ../
-rw-rw-r-- 1 vagrant vagrant 3333795 Sep  6 01:24 pygame-1.9.2a0-cp27-none-linux_x86_64.whl

您无法从已安装的模块创建轮子,因为它缺少安装说明部分 (setup.py)。有关更多信息,请查看车轮的使用说明

于 2015-09-06T01:31:58.260 回答