Python转动本地模块

时间:2015-09-06 00:38:59

标签: python python-2.7 pygame python-wheel

我正在编写一个需要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并将其添加到我的滚轮目录中?

1 个答案:

答案 0 :(得分:2)

你需要将pip指向源dir以制作一个轮子。 例如:

$ 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)。有关详情,请查看wheel's usage instructions