使用conda和python3k构建包

时间:2015-03-02 19:29:55

标签: python python-3.x conda

所以我在Win7上用conda构建一个包:

conda skeleton pypi $pkgname
conda build $pkgname
binstar upload ./conda-bld/win-64/$pkgname-py27_0.tar.bz2
conda install -c https://conda.binstar.org/myname $pkgname

使用python2k,这就像魅力一样。但是,使用python3k会失败,因为patch包不适用于python3k。错误(docopt的示例):

$ conda skeleton pypi docopt
Using url https://pypi.python.org/packages/source/d/docopt/docopt-0.6.2.tar.gz (25 KB) for docopt.
Downloading docopt (use --no-download to skip this step)
Using cached download
Unpacking docopt...
done
working in C:\cygwin64\tmp\tmpy7erx8vyconda_skeleton_docopt-0.6.2.tar.gz
Fetching package metadata: ......
Solving package specifications: .
Applying patch: 'C:\\cygwin64\\tmp\\tmpy7erx8vyconda_skeleton_docopt-0.6.2.tar.gz\\pypi-distutils.patch'
Error:
    Did not find 'patch' in: C:\Python\Anaconda3\envs\_build\Scripts;C:\Python\Anaconda3\Scripts;C:\cygwin\bin;C:\cygwin64\usr\local\bin;C:\cygwin64\bin;C:\Python\Python3\Lib\site-packages\PyQt4;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MiKTeX 2.9\miktex\bin\x64;C:\cygwin64\bin;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Python\Anaconda3;C:\Python\Anaconda3\Scripts;C:\cygwin64\lib\lapack
    You can install 'patch' using apt-get, yum (Linux), Xcode (MacOSX), or conda, cygwin (Windows)

尝试安装patch时:

$conda search ^patch$
Fetching package metadata: ....
patch                        1.12.11                  py27_0  defaults

python3k没有patch包 - 这是否意味着没有为我构建包?

1 个答案:

答案 0 :(得分:2)

您可以重复使用您使用Python 2构建的相同配方。或者您可以使用patchconda create -n patch patch)创建一个环境并将其放在PATH上。或者您可以从http://gnuwin32.sourceforge.net/packages/patch.htm安装补丁。