0

I have installed pytube by following command

sudo pip install pytube 

It's ok when I import pytube from python 2.x. But I am getting ImportError while importing from python3

jonyroy
  • 187
  • 1
  • 11
  • I would guess `pip` is for python 2 on your setup - try `which`? See this: https://stackoverflow.com/questions/11268501/how-to-use-pip-with-python-3-x-alongside-python-2-x – doctorlove Feb 02 '18 at 14:41
  • Possible duplicate of [Adding modules to Python3](https://stackoverflow.com/questions/20534556/adding-modules-to-python3) – joppich Feb 02 '18 at 14:42

2 Answers2

1

Try to install the package with pip3 (sudo pip3 install pytube), in some operating systems pip refers to python2 and pip3 refers to python3.

MosheZada
  • 2,189
  • 1
  • 14
  • 17
0

Try to install pytube3:

sudo pip3 install pytube3

And after that you should be able to import pytube