Using Python 3.13.2 and pytube 15.0.0
When I try to run a program that has from pytube import YouTube
I get the following error:
will.air@Mac python % python3 main.py ../test_text_files/tests.txt
Traceback (most recent call last):
File "/Users/will.air/YouTube_Downloader/python/main.py", line 3, in
<module>
from stats.py import download, downloadMulti, audioOnly, audioMulti,
getTotalRuntime
File "/Users/will.air/YouTube_Downloader/python/stats.py", line 1,
in <module>
from pytube import YouTube
ModuleNotFoundError: No module named 'pytube'
will.air@Mac python % pipx install pytube
'pytube' already seems to be installed. Not modifying existing
installation in '/Users/will.air/.local/pipx/venvs/pytube'. Pass
'--force' to force installation.
I've made sure that pytube is installed and in my Python PATH, but it still isn't working.
Using Python 3.13.2 and pytube 15.0.0
When I try to run a program that has from pytube import YouTube
I get the following error:
will.air@Mac python % python3 main.py ../test_text_files/tests.txt
Traceback (most recent call last):
File "/Users/will.air/YouTube_Downloader/python/main.py", line 3, in
<module>
from stats.py import download, downloadMulti, audioOnly, audioMulti,
getTotalRuntime
File "/Users/will.air/YouTube_Downloader/python/stats.py", line 1,
in <module>
from pytube import YouTube
ModuleNotFoundError: No module named 'pytube'
will.air@Mac python % pipx install pytube
'pytube' already seems to be installed. Not modifying existing
installation in '/Users/will.air/.local/pipx/venvs/pytube'. Pass
'--force' to force installation.
I've made sure that pytube is installed and in my Python PATH, but it still isn't working.
Share Improve this question edited Mar 17 at 20:58 Borne 116 bronze badges asked Mar 16 at 18:08 WillWill 1 3 |1 Answer
Reset to default 0Did you try reinstalling 'pytube'? If not, try
Method 1:
pipx uninstall pytube
pipx install pytube
That should work. If not, try
Method 2:
/your_py_file/.venv/lib/python3.13/pytube
If it's not there, install it. Else, delete it and install it using pipx again. This method is kinda dangerous, so use it causticly.
pytube
module was installed usingpipx
(i.e. for virtual environments). Try installing thepytube
module withpip
.pipx
is for standalone applications,pip
is forimport
ing modules into code. – Man made of meat Commented Mar 17 at 2:52pytube
. I usedpython3 -m pip install pytube
. – Man made of meat Commented Mar 18 at 0:44