indygreg / PyOxidizer

A modern Python application packaging and distribution tool
Mozilla Public License 2.0
5.4k stars 234 forks source link

Unable build project with aiohttp and asyncio #642

Open MateuszKrawczuk opened 1 year ago

MateuszKrawczuk commented 1 year ago

I tried to build the same project on Windows and Linux, without any success. I tried to build with pyoxidizer from pip and pyoxidizer build from cargo(Linux). I got the same error.

Bazzel config was generated by pyoxidizer init-config-file ProjectA and I uncommented only exe.add_python_resources(exe.pip_install(["-r", "requirements.txt"]))

/home/m.krawczuk/.cargo/bin/pyoxidizer run
resolving 1 targets
resolving target install
resolving target exe
target Python distribution for x86_64-unknown-linux-gnu resolves to: https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-x86_64-unknown-linux-gnu-pgo-full.tar.zst (sha256=ab27c27d034da39e999efce6bfa416be645918f27c13e89be9794dea0ef2f116)
reusing target Python distribution for host execution
installing modified distutils to /tmp/pyoxidizer-pip-installSEd957/packages
modifying distutils/_msvccompiler.py for oxidation
modifying distutils/command/build_ext.py for oxidation
modifying distutils/unixccompiler.py for oxidation
pip installing to /tmp/pyoxidizer-pip-installSEd957/install
Collecting qasync~=0.23.0
  Using cached qasync-0.23.0-py3-none-any.whl (13 kB)
Collecting PyQT6~=6.3.0
  Using cached PyQt6-6.3.1-cp37-abi3-manylinux1_x86_64.whl (7.8 MB)
Collecting asyncio~=3.4.3
  Using cached asyncio-3.4.3-py3-none-any.whl (101 kB)
Collecting aiohttp
  Using cached aiohttp-3.8.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.2 MB)
Collecting httpx
  Using cached httpx-0.23.0-py3-none-any.whl (84 kB)
Collecting uplink~=0.9.7
  Using cached uplink-0.9.7-py2.py3-none-any.whl (69 kB)
Collecting uplink-httpx
  Using cached uplink_httpx-2.0-py3-none-any.whl (4.5 kB)
Collecting numpy
  Using cached numpy-1.23.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
Collecting pandas~=1.4.2
  Using cached pandas-1.4.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB)
Collecting openpyxl
  Using cached openpyxl-3.0.10-py2.py3-none-any.whl (242 kB)
Collecting pip>=22.1.2
  Using cached pip-22.2.2-py3-none-any.whl (2.0 MB)
Collecting requests~=2.27.1
  Using cached requests-2.27.1-py2.py3-none-any.whl (63 kB)
Collecting keyring~=23.6.0
  Using cached keyring-23.6.0-py3-none-any.whl (34 kB)
Collecting PyQt6-Qt6>=6.3.0
  Using cached PyQt6_Qt6-6.3.1-py3-none-manylinux_2_28_x86_64.whl (52.4 MB)
Collecting PyQt6-sip<14,>=13.4
  Using cached PyQt6_sip-13.4.0-cp310-cp310-manylinux1_x86_64.whl (310 kB)
Collecting frozenlist>=1.1.1
  Using cached frozenlist-1.3.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (149 kB)
Collecting async-timeout<5.0,>=4.0.0a3
  Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting charset-normalizer<3.0,>=2.0
  Using cached charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting multidict<7.0,>=4.5
  Using cached multidict-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB)
Collecting aiosignal>=1.1.2
  Using cached aiosignal-1.2.0-py3-none-any.whl (8.2 kB)
Collecting yarl<2.0,>=1.0
  Using cached yarl-1.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (263 kB)
Collecting attrs>=17.3.0
  Using cached attrs-22.1.0-py2.py3-none-any.whl (58 kB)
Collecting certifi
  Using cached certifi-2022.9.14-py3-none-any.whl (162 kB)
Collecting rfc3986[idna2008]<2,>=1.3
  Using cached rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)
Collecting sniffio
  Using cached sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting httpcore<0.16.0,>=0.15.0
  Using cached httpcore-0.15.0-py3-none-any.whl (68 kB)
Collecting uritemplate>=3.0.0
  Using cached uritemplate-4.1.1-py2.py3-none-any.whl (10 kB)
Collecting six>=1.13.0
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting httpx
  Using cached httpx-1.0.0b0-py3-none-any.whl (82 kB)
Collecting pytz>=2020.1
  Using cached pytz-2022.2.1-py2.py3-none-any.whl (500 kB)
Collecting python-dateutil>=2.8.1
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting et-xmlfile
  Using cached et_xmlfile-1.1.0-py3-none-any.whl (4.7 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
Collecting charset-normalizer<3.0,>=2.0
  Using cached charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting jeepney>=0.4.2
  Using cached jeepney-0.8.0-py3-none-any.whl (48 kB)
Collecting SecretStorage>=3.2
  Using cached SecretStorage-3.3.3-py3-none-any.whl (15 kB)
Collecting h11<0.13,>=0.11
  Using cached h11-0.12.0-py3-none-any.whl (54 kB)
Collecting anyio==3.*
  Using cached anyio-3.6.1-py3-none-any.whl (80 kB)
Collecting cryptography>=2.0
  Using cached cryptography-38.0.1-cp36-abi3-manylinux_2_28_x86_64.whl (4.2 MB)
Collecting cffi>=1.12
  Using cached cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Installing collected packages: rfc3986, pytz, PyQt6-Qt6, asyncio, urllib3, uritemplate, sniffio, six, qasync, PyQt6-sip, pycparser, pip, numpy, multidict, jeepney, idna, h11, frozenlist, et-xmlfile, charset-normalizer, certifi, attrs, async-timeout, yarl, requests, python-dateutil, PyQT6, openpyxl, cffi, anyio, aiosignal, uplink, pandas, httpcore, cryptography, aiohttp, SecretStorage, httpx, uplink-httpx, keyring
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
xdis 6.0.4 requires click, which is not installed.
requests-oauthlib 1.3.1 requires oauthlib>=3.0.0, which is not installed.
pynsist 2.8 requires jinja2, which is not installed.
jira 3.3.1 requires packaging, which is not installed.
decompyle3 3.9.0 requires click, which is not installed.
Successfully installed PyQT6-6.3.1 PyQt6-Qt6-6.3.1 PyQt6-sip-13.4.0 SecretStorage-3.3.3 aiohttp-3.8.1 aiosignal-1.2.0 anyio-3.6.1 async-timeout-4.0.2 asyncio-3.4.3 attrs-22.1.0 certifi-2022.9.14 cffi-1.15.1 charset-normalizer-2.0.12 cryptography-38.0.1 et-xmlfile-1.1.0 frozenlist-1.3.1 h11-0.12.0 httpcore-0.15.0 httpx-0.23.0 idna-3.4 jeepney-0.8.0 keyring-23.6.0 multidict-6.0.2 numpy-1.23.3 openpyxl-3.0.10 pandas-1.4.4 pip-22.2.2 pycparser-2.21 python-dateutil-2.8.2 pytz-2022.2.1 qasync-0.23.0 requests-2.27.1 rfc3986-1.5.0 six-1.16.0 sniffio-1.3.0 uplink-0.9.7 uplink-httpx-2.0 uritemplate-4.1.1 urllib3-1.26.12 yarl-1.8.1
adding Python executable ProjectA to .
ensuring Rust toolchain 1.61.0 is available
rustc for x86_64-unknown-linux-gnu in /home/m.krawczuk/.cache/pyoxidizer/rust/1.61.0-x86_64-unknown-linux-gnu is up-to-date
cargo for x86_64-unknown-linux-gnu in /home/m.krawczuk/.cache/pyoxidizer/rust/1.61.0-x86_64-unknown-linux-gnu is up-to-date
rust-std for x86_64-unknown-linux-gnu in /home/m.krawczuk/.cache/pyoxidizer/rust/1.61.0-x86_64-unknown-linux-gnu is up-to-date
     Created binary (application) package
writing /tmp/pyoxidizer3QmZay/ProjectA/.cargo/config
writing /tmp/pyoxidizer3QmZay/ProjectA/Cargo.lock
writing /tmp/pyoxidizer3QmZay/ProjectA/build.rs
writing /tmp/pyoxidizer3QmZay/ProjectA/src/main.rs
writing /tmp/pyoxidizer3QmZay/ProjectA/pyoxidizer.bzl
writing /tmp/pyoxidizer3QmZay/ProjectA/ProjectA.exe.manifest
writing /tmp/pyoxidizer3QmZay/ProjectA/ProjectA-manifest.rc
error[PYOXIDIZER_PYTHON_EXECUTABLE]: adding PythonExecutable to FileManifest

    Caused by:
        0: building Python executable
        1: building executable with Rust project
        2: obtaining embedded python context
        3: converting asyncio.base_events to resource
        4: compiling relative path module bytecode
        5: compiling error: invalid syntax (asyncio.base_events, line 296)
       --> ./pyoxidizer.bzl:283:5
        |
    283 |     files.add_python_resource(".", exe)
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PythonExecutable.to_file_manifest()

error: adding PythonExecutable to FileManifest

Caused by:
    0: building Python executable
    1: building executable with Rust project
    2: obtaining embedded python context
    3: converting asyncio.base_events to resource
    4: compiling relative path module bytecode
    5: compiling error: invalid syntax (asyncio.base_events, line 296)
saraswatpuneet commented 4 months ago

asyncio get packaged with standard library from python3.4 , I think you should be able to build aiohttp and aiofiles too , you can remove ayscio from requirements and try ?