单点命令将tarball或zip安装为方向盘

时间:2017-02-16 09:05:22

标签: python pip python-wheel

我无法找到单个pip命令从存储库(svn,git)或tarball / zip作为滚轮安装。我使用的是Python 2.7。例如,Genshi仅作为tarball or zip从PyPI获得。包装安装为鸡蛋:

~$virtualenv pve
New python executable in /Users/rjollos/pve/bin/python2.7
Also creating executable in /Users/rjollos/pve/bin/python
Installing setuptools, pip, wheel...done.
~$. pve/bin/activate
(pve) ~$pip install -U pip wheel setuptools
Collecting pip
  Using cached pip-9.0.1-py2.py3-none-any.whl
Collecting wheel
  Using cached wheel-0.29.0-py2.py3-none-any.whl
Collecting setuptools
  Downloading setuptools-34.2.0-py2.py3-none-any.whl (389kB)
    100% |████████████████████████████████| 393kB 810kB/s 
Collecting packaging>=16.8 (from setuptools)
  Using cached packaging-16.8-py2.py3-none-any.whl
Collecting six>=1.6.0 (from setuptools)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting appdirs>=1.4.0 (from setuptools)
  Using cached appdirs-1.4.0-py2.py3-none-any.whl
Collecting pyparsing (from packaging>=16.8->setuptools)
  Using cached pyparsing-2.1.10-py2.py3-none-any.whl
Installing collected packages: pip, wheel, six, pyparsing, packaging, appdirs, setuptools
  Found existing installation: pip 8.0.2
    Uninstalling pip-8.0.2:
      Successfully uninstalled pip-8.0.2
  Found existing installation: wheel 0.26.0
    Uninstalling wheel-0.26.0:
      Successfully uninstalled wheel-0.26.0
  Found existing installation: setuptools 19.6.2
    Uninstalling setuptools-19.6.2:
      Successfully uninstalled setuptools-19.6.2
Successfully installed appdirs-1.4.0 packaging-16.8 pip-9.0.1 pyparsing-2.1.10 setuptools-34.2.0 six-1.10.0 wheel-0.29.0
$pip install --no-cache-dir genshi
Collecting genshi
  Downloading Genshi-0.7.tar.gz (491kB)
    100% |████████████████████████████████| 501kB 1.8MB/s 
Installing collected packages: genshi
  Running setup.py install for gens
$ls -ld pve/lib/python2.7/site-packages/Genshi*
drwxr-xr-x  9 rjollos  staff  306 Feb 16 00:36 pve/lib/python2.7/site-packages/Genshi-0.7-py2.7.egg-info

作为解决方法,我可以创建一个轮子,然后安装轮子:

(pve) ~$pip wheel --no-cache-dir --wheel-dir wheels genshi
Collecting genshi
  Downloading Genshi-0.7.tar.gz (491kB)
    100% |████████████████████████████████| 501kB 1.7MB/s 
Building wheels for collected packages: genshi
  Running setup.py bdist_wheel for genshi ... done
  Stored in directory: /Users/rjollos/wheels
Successfully built genshi
(pve) ~$pip install wheels/Genshi-0.7-cp27-cp27m-macosx_10_12_x86_64.whl 
Processing ./wheels/Genshi-0.7-cp27-cp27m-macosx_10_12_x86_64.whl
Installing collected packages: Genshi
Successfully installed Genshi-0.7
(pve) ~$ls -ld pve/lib/python2.7/site-packages/Genshi*
drwxr-xr-x  10 rjollos  staff  340 Feb 16 00:43 pve/lib/python2.7/site-packages/Genshi-0.7.dist-info

有没有办法在单个pip命令中从tarball / zip存档构建和安装滚轮? --wheel似乎没有pip install选项。有一个--only-binary选项,但如果找不到预建的轮子,它将会失败。

0 个答案:

没有答案