首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在Windows上使用Github操作进行Python测试

在Windows上使用Github操作进行Python测试
EN

Stack Overflow用户
提问于 2020-05-02 19:40:27
回答 1查看 371关注 0票数 0

我正在尝试使用GitHub操作在Windows上测试Python包。下面的作业描述在Linux和MacOS上是成功的,但是在Windows上最后的Test ${{ matrix.os }} binding部分失败了。

代码语言:javascript
运行
复制
  test:
    strategy:
      matrix:
        os: [windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v1
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          default: true
      - name: Unit tests
        run: cargo test
      - uses: actions/setup-python@v1
        with:
          python-version: '3.7'
      - name: Test ${{ matrix.os }} binding
        run: |
          python3 -m venv venv3
          venv3\Scripts\Activate.ps1
          python3 -m pip install maturin numpy
          maturin develop
          python3 -m unittest discover tests

这是产生的错误日志。

代码语言:javascript
运行
复制
2020-05-02T11:26:46.8753138Z ##[group]Run actions/setup-python@v1
2020-05-02T11:26:46.8753394Z with:
2020-05-02T11:26:46.8753556Z   python-version: 3.7
2020-05-02T11:26:46.8753701Z   architecture: x64
2020-05-02T11:26:46.8753843Z ##[endgroup]
2020-05-02T11:26:46.9972224Z Successfully setup CPython (3.7.6)
2020-05-02T11:26:47.0429209Z ##[group]Run python3 -m venv venv3
2020-05-02T11:26:47.0429485Z python3 -m venv venv3
2020-05-02T11:26:47.0429617Z venv3\Scripts\Activate.ps1
2020-05-02T11:26:47.0429746Z python3 -m pip install maturin numpy
2020-05-02T11:26:47.0429871Z maturin develop
2020-05-02T11:26:47.0430000Z python3 -m unittest discover tests
2020-05-02T11:26:47.0470479Z shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
2020-05-02T11:26:47.0470607Z env:
2020-05-02T11:26:47.0470733Z   pythonLocation: C:\hostedtoolcache\windows\Python\3.7.6\x64
2020-05-02T11:26:47.0470858Z ##[endgroup]
2020-05-02T11:26:57.7836092Z ##[error]Process completed with exit code 1.
2020-05-02T11:26:57.7855441Z Cleaning up orphan processes

我不清楚为什么它会失败。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-05-04 21:47:25

Python3可执行文件通常可以在Linux和Mac上的python3上使用,默认的python可能是旧的python2,但在Windows上情况并非如此,所以解决方案就是使用python

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61558780

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档