get-pytube / pytube3

A lightweight, dependency-free Python 3 library (and command-line utility) for downloading YouTube Videos.
https://pytube3.readthedocs.io
Other
178 stars 55 forks source link

Error throwing when trying to import youtube #28

Closed shepherd-06 closed 4 years ago

shepherd-06 commented 4 years ago

The following exception with traceback is throwing when I try to import youtube

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/bashar/.virtualenv/musical-octo-journey/lib/python3.5/site-packages/pytube/__init__.py", line 14, in <module>
    from pytube.streams import Stream
  File "/Users/bashar/.virtualenv/musical-octo-journey/lib/python3.5/site-packages/pytube/streams.py", line 55
    self._filesize: Optional[int] = None  # filesize in bytes
                  ^
SyntaxError: invalid syntax```

I tried the documentation code and the problem persists. So the steps to reproduce this error is to simply run the following codes

from pytube import YouTube


pytube version

autopep8==1.5 prompt-toolkit==1.0.14 pycodestyle==2.5.0 Pygments==2.5.2 PyInquirer==1.0.3 pytube3==9.5.8 regex==2020.1.8 six==1.14.0 typing-extensions==3.7.4.1 wcwidth==0.1.8



Thank you.
shepherd-06 commented 4 years ago

Issue resolved. I was working with python 3.5.4, this package workes >=python3.6. I recommend mentioning it somewhere or in the package's error handling.