try using a virtual environment :
python -m venv venv
source ./venv/bin/activate # Linux
.\venv\Scripts\activate # Windows
pip3 install pytube
also there is another issue being discussed in the github repo , also i would recommend using yt-dlp as this is updated more often and the bug fixes are quicker