Skip to content

When I use Poetry and Nuitka/Nuitka-Action@main, Nuitka cannot utilize the Python interpreter from the Poetry virtual environment. #55

@xhatt

Description

@xhatt

This is Actions file

name: Nuitka on Windows

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install poetry
        run: pip install poetry
      - uses: actions/setup-python@v5
        with:
          python-version-file: 'pyproject.toml'
          cache: 'poetry'
      - name: Configure Poetry
        run: poetry config virtualenvs.create false
      - name: Install dependencies
        run: |
          poetry source remove tsinghua
          poetry lock --no-update
          poetry install
          poetry show
          poetry env list
          poetry env info
      - name: Show pip list
        run: python -m pip list
      - name: Build package
        uses: Nuitka/Nuitka-Action@main
        with:
          nuitka-version: main
          script-name: main.py
          onefile: true
          enable-plugins: tk-inter
          include-data-files: |
            ./dll/*.dll=dll/
            logo.ico=logo.ico
          windows-icon-from-ico: logo.ico
          output-file: 推特助手.exe
#          windows-console-mode: true


      - name: Upload Artifacts
        uses: actions/upload-artifact@v4
        with:
          name: twitter_bot
          path: build/*.exe

python -m pip list no things

Output:

Run python -m pip list
  python -m pip list
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    pythonLocation: C:\hostedtoolcache\windows\Python\3.1[2](https://github.com/xhatt/twitter_bot/actions/runs/9586123141/job/26433411787#step:7:2).3\x64
    PKG_CONFIG_PATH: C:\hostedtoolcache\windows\Python\[3](https://github.com/xhatt/twitter_bot/actions/runs/9586123141/job/26433411787#step:7:3).12.3\x64/lib/pkgconfig
    Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.12.3\x6[4](https://github.com/xhatt/twitter_bot/actions/runs/9586123141/job/26433411787#step:7:4)
    Python2_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.12.3\x[6](https://github.com/xhatt/twitter_bot/actions/runs/9586123141/job/26433411787#step:7:6)4
    Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.12.3\x64
Package Version
------- -------
pip     24.0

but poetry show output

aiohttp                   3.9.5    Async http client/server framework (asyn...
aiohttp-socks             0.8.4    Proxy connector for aiohttp
aiosignal                 1.3.1    aiosignal: a list of registered asynchro...
altgraph                  0.17.4   Python graph (network) package
annotated-types           0.6.0    Reusable constraint types to use with ty...
async-timeout             4.0.3    Timeout context manager for asyncio prog...
attrs                     23.2.0   Classes Without Boilerplate
certifi                   2024.6.2 Python package for providing Mozilla's C...
cffi                      1.16.0   Foreign Function Interface for Python ca...
charset-normalizer        3.3.2    The Real First Universal Charset Detecto...

This will result in Nuitka being unable to obtain a valid dependency environment. I also tried to install Poetry directly in the local environment, but it doesn't seem to work either.
Thank you very much if it can be resolved, otherwise I can only use pip. Perhaps there could be a parameter that can mark where to use Python from?
——Translate through Baidu

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions