Python构建工具安装和打包task.setvariable失败

时间:2018-11-27 23:27:09

标签: python powershell azure-devops azure-pipelines

我正在尝试使用Python build tools为我的项目运行CI。

但是,推荐的“安装Python”任务失败,无法处理命令'## vso [task.setvariable:

2018-11-27T09:01:45.8077207Z ##[section]Starting: Install Python
2018-11-27T09:01:45.8084595Z ==============================================================================
2018-11-27T09:01:45.8084738Z Task         : Install Python on Windows
2018-11-27T09:01:45.8084853Z Description  : Installs one or more Python versions into your build environment
2018-11-27T09:01:45.8084937Z Version      : 1.0.13
2018-11-27T09:01:45.8085016Z Author       : Steve Dower
2018-11-27T09:01:45.8085188Z Help         : The *Install Python* task will install Python using a package from [nuget.org](https://nuget.org) and add it to `PATH`. These packages are part of the official release of CPython.

Most other tasks assume you have already run this task to install the desired runtime. The folder where they are installed is customizable, but be aware that you may need to update subsequent task configuration if you change this.

The recommended configuration for using this task with multiple versions of Python is to enable multi-configuration on the phase and specify the version number as a Multiplier. See [the documentation](https://go.microsoft.com/fwlink/?linkid=835763) for information about parallel execution.

(Note that the first-party *Use Python Version* task is preferable on the Hosted queues and works on all platforms, though as of 02 May 2018 is not fully available.)
2018-11-27T09:01:45.8085489Z ==============================================================================
2018-11-27T09:02:00.5624146Z ##[command]"C:\vsts-agent\_work\_tasks\InstallPython_6095fbbe-853d-4f2e-bc15-a88c92a78b4d\1.0.13\nuget.exe" install -OutputDirectory "C:\vsts-agent\_work\_tool\PythonNuget"  python
2018-11-27T09:02:02.3259235Z Feeds used:
2018-11-27T09:02:02.3260274Z   https://api.nuget.org/v3/index.json
2018-11-27T09:02:02.3265409Z 
2018-11-27T09:02:02.3356523Z Installing package 'python' to 'C:\vsts-agent\_work\_tool\PythonNuget'.
2018-11-27T09:02:03.3744998Z   GET https://api.nuget.org/v3/registration3-gz-semver2/python/index.json
2018-11-27T09:02:04.2195046Z   OK https://api.nuget.org/v3/registration3-gz-semver2/python/index.json 844ms
2018-11-27T09:02:04.6414413Z Package "python.3.7.1" is already installed.
2018-11-27T09:02:04.9698862Z ##[error]Unable to process command '##vso[task.setvariable variable=pythonLocation;issecret=False]C:\vsts-agent\_work\_tool\PythonNuget\python.3.7.1\tools' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
2018-11-27T09:02:04.9723742Z ##[error]Value cannot be null.
Parameter name: RefName
2018-11-27T09:02:05.0583055Z ##[section]Finishing: Install Python

安装本身似乎已经成功,因为我可以禁用该步骤并使用手动设置的变量运行软件包任务。 但是,此任务也会失败,并显示类似错误:

2018-11-27T09:19:58.1789219Z ##[section]Starting: Build wheels from setup.py
2018-11-27T09:19:58.1797911Z ==============================================================================
2018-11-27T09:19:58.1798116Z Task         : Build Python wheels
2018-11-27T09:19:58.1798220Z Description  : Creates a wheel using an installed copy of Python.
2018-11-27T09:19:58.1798313Z Version      : 1.0.6
2018-11-27T09:19:58.1798408Z Author       : Steve Dower
2018-11-27T09:19:58.1798530Z Help         : The *Build Python wheels* task uses a `setup.py` file to compile wheels. It will ensure that `pip`, `wheel`, `setuptools` and `cython` are installed before running.
2018-11-27T09:19:58.1798632Z ==============================================================================
2018-11-27T09:20:00.1574022Z ##[command]"C:\vsts-agent\_work\_tool\PythonNuget\python.3.7.1\tools\python.exe" -m pip install pip setuptools wheel cython
2018-11-27T09:20:09.3277504Z Requirement already satisfied: pip in c:\vsts-agent\_work\_tool\pythonnuget\python.3.7.1\tools\lib\site-packages (10.0.1)
2018-11-27T09:20:09.3647762Z Requirement already satisfied: setuptools in c:\vsts-agent\_work\_tool\pythonnuget\python.3.7.1\tools\lib\site-packages (39.0.1)
2018-11-27T09:20:09.4030940Z Collecting wheel
2018-11-27T09:20:10.1048438Z   Downloading https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
2018-11-27T09:20:10.2095319Z Collecting cython
2018-11-27T09:20:10.8171412Z   Downloading https://files.pythonhosted.org/packages/de/c8/daeef2f83ae402fc3c3eef4295e07fc46b267e5f12c7a8ee05b685de5c59/Cython-0.29.1-cp37-cp37m-win_amd64.whl (1.7MB)
2018-11-27T09:20:11.6943676Z Installing collected packages: wheel, cython
2018-11-27T09:20:11.8283445Z   The script wheel.exe is installed in 'C:\vsts-agent\_work\_tool\PythonNuget\python.3.7.1\tools\Scripts' which is not on PATH.
2018-11-27T09:20:11.8283671Z   Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
2018-11-27T09:20:15.3438913Z   The scripts cygdb.exe, cython.exe and cythonize.exe are installed in 'C:\vsts-agent\_work\_tool\PythonNuget\python.3.7.1\tools\Scripts' which is not on PATH.
2018-11-27T09:20:15.3439571Z   Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
2018-11-27T09:20:15.3891222Z Successfully installed cython-0.29.1 wheel-0.32.3
2018-11-27T09:20:15.8153804Z You are using pip version 10.0.1, however version 18.1 is available.
2018-11-27T09:20:15.8154881Z You should consider upgrading via the 'python -m pip install --upgrade pip' command.
2018-11-27T09:20:15.9164164Z ##[command]"C:\vsts-agent\_work\_tool\PythonNuget\python.3.7.1\tools\python.exe" "C:\vsts-agent\_work\1\s\setup.py" build --build-base "C:\vsts-agent\_work\1\b" bdist_wheel -d "C:\vsts-agent\_work\1\a" --universal
2018-11-27T09:20:17.2811564Z running build
2018-11-27T09:20:17.2812503Z running build_py
2018-11-27T09:20:17.7476566Z creating C:\vsts-agent\_work\1\b\lib
2018-11-27T09:20:17.7478546Z creating C:\vsts-agent\_work\1\b\lib\pvsdockerlib
2018-11-27T09:20:17.7487714Z copying pvsdockerlib\functions.py -> C:\vsts-agent\_work\1\b\lib\pvsdockerlib
2018-11-27T09:20:17.7509731Z copying pvsdockerlib\__init__.py -> C:\vsts-agent\_work\1\b\lib\pvsdockerlib
2018-11-27T09:20:17.7528017Z running bdist_wheel
2018-11-27T09:20:17.7948184Z installing to C:\vsts-agent\_work\1\b\bdist.win-amd64\wheel
2018-11-27T09:20:17.7950366Z running install
2018-11-27T09:20:17.7960351Z running install_lib
2018-11-27T09:20:17.8287382Z creating C:\vsts-agent\_work\1\b\bdist.win-amd64
2018-11-27T09:20:17.8290061Z creating C:\vsts-agent\_work\1\b\bdist.win-amd64\wheel
2018-11-27T09:20:17.8300030Z creating C:\vsts-agent\_work\1\b\bdist.win-amd64\wheel\pvsdockerlib
2018-11-27T09:20:17.8310198Z copying C:\vsts-agent\_work\1\b\lib\pvsdockerlib\functions.py -> C:\vsts-agent\_work\1\b\bdist.win-amd64\wheel\.\pvsdockerlib
2018-11-27T09:20:17.8333787Z copying C:\vsts-agent\_work\1\b\lib\pvsdockerlib\__init__.py -> C:\vsts-agent\_work\1\b\bdist.win-amd64\wheel\.\pvsdockerlib
2018-11-27T09:20:17.8348679Z running install_egg_info
2018-11-27T09:20:18.0161526Z running egg_info
2018-11-27T09:20:18.0162158Z creating pvs_dockerlib.egg-info
2018-11-27T09:20:18.0169182Z writing pvs_dockerlib.egg-info\PKG-INFO
2018-11-27T09:20:18.0184157Z writing dependency_links to pvs_dockerlib.egg-info\dependency_links.txt
2018-11-27T09:20:18.0199803Z writing requirements to pvs_dockerlib.egg-info\requires.txt
2018-11-27T09:20:18.0208911Z writing top-level names to pvs_dockerlib.egg-info\top_level.txt
2018-11-27T09:20:18.0227310Z writing manifest file 'pvs_dockerlib.egg-info\SOURCES.txt'
2018-11-27T09:20:18.0262855Z reading manifest file 'pvs_dockerlib.egg-info\SOURCES.txt'
2018-11-27T09:20:18.0307698Z writing manifest file 'pvs_dockerlib.egg-info\SOURCES.txt'
2018-11-27T09:20:18.0320556Z Copying pvs_dockerlib.egg-info to C:\vsts-agent\_work\1\b\bdist.win-amd64\wheel\.\pvs_dockerlib-0.1-py3.7.egg-info
2018-11-27T09:20:18.0449785Z running install_scripts
2018-11-27T09:20:18.2548207Z adding license file "LICENSE" (matched pattern "LICEN[CS]E*")
2018-11-27T09:20:18.2597715Z creating C:\vsts-agent\_work\1\b\bdist.win-amd64\wheel\pvs_dockerlib-0.1.dist-info\WHEEL
2018-11-27T09:20:18.2616849Z creating 'C:\vsts-agent\_work\1\a\pvs_dockerlib-0.1-py2.py3-none-any.whl' and adding 'C:\vsts-agent\_work\1\b\bdist.win-amd64\wheel' to it
2018-11-27T09:20:18.2642603Z adding 'pvsdockerlib/__init__.py'
2018-11-27T09:20:18.2660569Z adding 'pvsdockerlib/functions.py'
2018-11-27T09:20:18.2668323Z adding 'pvs_dockerlib-0.1.dist-info/LICENSE'
2018-11-27T09:20:18.2674321Z adding 'pvs_dockerlib-0.1.dist-info/METADATA'
2018-11-27T09:20:18.2679798Z adding 'pvs_dockerlib-0.1.dist-info/WHEEL'
2018-11-27T09:20:18.2685103Z adding 'pvs_dockerlib-0.1.dist-info/top_level.txt'
2018-11-27T09:20:18.2688000Z adding 'pvs_dockerlib-0.1.dist-info/RECORD'
2018-11-27T09:20:18.2691808Z removing C:\vsts-agent\_work\1\b\bdist.win-amd64\wheel
2018-11-27T09:20:18.2719804Z C:\vsts-agent\_work\_tool\PythonNuget\python.3.7.1\tools\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
2018-11-27T09:20:18.2720555Z   warnings.warn(msg)
2018-11-27T09:20:18.5079776Z ##[error]Unable to process command '##vso[task.setvariable variable=dist;issecret=False]C:\vsts-agent\_work\1\a' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
2018-11-27T09:20:18.5106520Z ##[error]Value cannot be null.
Parameter name: RefName
2018-11-27T09:20:18.5664259Z ##[section]Finishing: Build wheels from setup.py

当Python构建工具使用内置的powershell命令Set-VstsTaskVariable时,这怎么可能?

Github Python build tools install set pythonLocation var

Github Python build tools package set dist var

这是azure-pipelines-agent中的错误吗?我正在使用最新的预发行版v2.141.2和本地TFS 2017更新3.1

0 个答案:

没有答案
相关问题