How to install dev package for python3.11?

There are two python version in my os.Python 3.9.2 is the default binding package with debian11.I installed python3.11 this way:

    sudo apt-get install -y bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf   \
         build-essential libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata ffmpeg liblapack3 \
         liblapack-dev libatlas-base-dev  libsqlite3-dev  sqlite3
    
    curl -O https://www.python.org/ftp/python/3.11.0/Python-3.11.0rc2.tar.xz
    tar -xf Python-3.11.0rc2.tar.xz
    cd Python-3.11.0rc2/
    ./configure --enable-optimizations
    make -j 4
    sudo make altinstall

1.when i install python3-dev ,it works for python3.9?

sudo apt-get install -y python3-dev

2.How can install dev package for python3.11 then?

The files in python3-dev are for the python3 that debian packages.

Since you have built python3.11 for yourself you also have all the files for the dev from the source kit.