Pytube module not found

Question:

I installed pytube via pip, uninstalled it and reinstalled it couple off times, but always I’m getting an error “ModuleNotFoundError: No module named ‘pytube'”.
When I insatlled it via cmd this is what it outputs(warning)

The script pytube.exe is installed in ‘C:UsersvidAppDataRoamingPythonPython37Scripts’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use –no-warn-script-location.

trying to fix the problem for like 2 hours now. Help

Asked By: KyiKyi

||

Answers:

  1. Run cmd as -> Right click, Run as Administrator and try again
  2. You may have 2 different Python installed, one from anaconda and one independent. Uninstall one and keep the conda one only
  3. Reinstall, but run the installer as Administrator
  4. Update pip “pip install –upgrade pip”
Answered By: NiLInfinite

I repaired that using:
pip install pytube3, which adds the newer pytube version which python supports.

Answered By: Kristian Dhimitri

I solved this problem by this way:

The warning you’re seeing indicates that the script pytube.exe is installed in a directory that is not included in your system’s PATH environment variable. To resolve this issue, you can take one of the following approaches:
Add the Directory to the PATH:

You can add the directory containing pytube.exe to your system’s PATH environment variable. Here’s how you can do it:
Open the Start menu, type "Environment Variables," and select "Edit the system environment variables."
In the System Properties window, click the "Environment Variables" button.
In the Environment Variables window, under "System variables," find the "Path" variable and click "Edit."
In the Edit Environment Variable window, click "New" and then enter the full path to the directory containing.

Click "OK" to close all the windows.
Open a new command prompt or terminal window, and the pytube command should now work without the warning.

Answered By: Abdulrahman
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.