ERROR: Could not build wheels for aiohttp, which is required to install pyproject.toml-based projects
Asked Answered
L

8

29

Python version: 3.11

Installing dependencies for an application by pip install -r requirements.txt gives the following error:

socket.c -o build/temp.linux-armv8l-cpython-311/aiohttp/_websocket.o
aiohttp/_websocket.c:198:12: fatal error: 'longintrepr.h' file not found
#include "longintrepr.h"                                   
          ^~~~~~~                        1 error generated.
error: command '/data/data/com.termux/files/usr/bin/arm-linux-androideabi-clang' 
failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for aiohttp
Failed to build aiohttp
ERROR: Could not build wheels for aiohttp, which is required to install
pyproject.toml-based projects

This error is specific to Python 3.11 version. On Python with 3.10.6 version installation goes fine.

Related question: yarl/_quoting.c:196:12: fatal error: 'longintrepr.h' file not found - 1 error generated

Laddie answered 23/11, 2022 at 17:27 Comment(1)
L
20

Solution for this error: need to update requirements.txt.

Not working versions of modules with Python 3.11:

aiohttp==3.8.1
yarl==1.4.2
frozenlist==1.3.0

Working versions:

aiohttp==3.8.2
yarl==1.8.1
frozenlist==1.3.1

Links to the corresponding issues with fixes:

Laddie answered 23/11, 2022 at 17:27 Comment(0)
A
26

aiohttp support for python 3.11/3.12 is still in beta, if you want to use that upgrade aiohttp version to 3.9.0b0

aiohttp==3.9.0b0

ref : https://github.com/aio-libs/aiohttp/issues/7675

Avowed answered 18/10, 2023 at 18:48 Comment(2)
I could build it using python 3.11.6. Couldn't build using 3.12 so I think this only affects 3.12.Prominent
It is Only affecting python 3.12...#77389420Inconvertible
L
20

Solution for this error: need to update requirements.txt.

Not working versions of modules with Python 3.11:

aiohttp==3.8.1
yarl==1.4.2
frozenlist==1.3.0

Working versions:

aiohttp==3.8.2
yarl==1.8.1
frozenlist==1.3.1

Links to the corresponding issues with fixes:

Laddie answered 23/11, 2022 at 17:27 Comment(0)
S
5

If you encountered some issues with downgrading you aiohttp version into 3.8.1 as me , you can go with other approach.

  • Download the .whl file manually from alpaca_trade_api-2.3.0-py3-none-any.whl

  • Then open the .whl file with 7-zip.

  • Go to alpaca_trade_api-2.3.0.dist-info\METADATA

  • Open this file for edit and change the requirement in line 21

    from:

       Requires-Dist: aiohttp (==3.8.1)
    

    to:

       Requires-Dist: aiohttp (==3.8.4)
    
  • Save this change.

  • Go to terminal and install this wheel manually

     python -pip instal (file_location)/alpaca_trade_api-2.3.0-py3-none-any.whl 
    

Worked great for me.

Snitch answered 22/2, 2023 at 17:14 Comment(0)
M
5

Run on your windows terminal,

pip install aiohttp==3.9.0b0
Marchall answered 3/11, 2023 at 9:43 Comment(0)
M
2

This works for me

pip install aiohttp==3.8.2 yarl==1.8.1 frozenlist==1.3.1 typing-extensions

pip install github==1.2.7 --no-dependencies
Mcdougald answered 27/4, 2023 at 7:37 Comment(0)
P
1

Always try to resolve such problems by writting on paper like by answering these questions: What are you installing? aiohttp what you need correcr version of dependencies? check what version of python you have and search which version of aiohttp is going to be compatible with your python version in my case I have python==3.12.0 which is going to be comaptible with aiohttp==3.9.0b0

so just write pip install aiohttp==3.9.0b0

Pucka answered 4/11, 2023 at 1:52 Comment(0)
M
0

Here's something that helped me.

  1. Remove the version from the package that is having issues
  2. run pip3 install -r requirements.txt
  3. run pip3 freeze > some_file_name.txt
  4. Check the versions being used in some_file_name.txt for the package that were having issues and copy the version to the main requirements.txt

Hope that helps.

Marlinmarline answered 16/5 at 21:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.