joelibaceta / video-to-ascii

It is a simple python package to play videos in the terminal using characters as pixels
MIT License
1.67k stars 141 forks source link

AttributeError: module 'time' has no attribute 'clock' #59

Open Wolfyxon opened 3 years ago

Wolfyxon commented 3 years ago

Describe the bug Error when trying to play video. When I run the command, it prints:

Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\...\PycharmProjects\badApple\venv\Scripts\video-to-ascii.exe\__main__.py", line 7, in <module>
  File "c:\users\...\pycharmprojects\badapple\venv\lib\site-packages\video_to_ascii\cli.py", line 21, in main
    player.play(ARGS.file, strategy=ARGS.strategy, output=ARGS.output, play_audio=ARGS.with_audio)
  File "c:\users\...\pycharmprojects\badapple\venv\lib\site-packages\video_to_ascii\player.py", line 23, in play
    engine.play(output)
  File "c:\users\...\pycharmprojects\badapple\venv\lib\site-packages\video_to_ascii\video_engine.py", line 36, in play
    self.render_strategy.render(self.read_buffer,
  File "c:\users\...\pycharmprojects\badapple\venv\lib\site-packages\video_to_ascii\render_strategy\ascii_strategy.py", line 120, in render
    t0 = time.clock()
AttributeError: module 'time' has no attribute 'clock'

I have all required modules installed

To Reproduce Steps to reproduce the behavior:

  1. Go to terminal
  2. type video-to-ascii -f some_video.mp4
  3. See error

Expected behavior The video should play.

Screenshots image

Desktop (please complete the following information):

RajvirSingh1313 commented 3 years ago

I am getting it too, I hope they will fix it as soon as possible.

frankrx41 commented 3 years ago

+1 My py version is 3.9.5

ziposcar commented 3 years ago

+1 3.9.2

yusufusta commented 2 years ago

43 it's merged. just need the new version of package

RajvirSingh1313 commented 2 years ago

Thanks Alot, gona make some cool projects with it

Indhar01 commented 2 years ago

upgrade your sqlalchemy pip install sqlalchemy --upgrade

waipeinan commented 2 years ago

same error, AttributeError: module 'time' has no attribute 'clock'

have upgraded sqlalchemy, changes all instance of clock replacing with time (three or four instances I think)

scillidan commented 2 years ago

+1 3.10.2

RedDragonTix commented 1 year ago

same here on 3.10

Traiver commented 1 year ago

I think the solution will also work for Windows, so here is the solution for Unix:

folder: cd /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/video_to_ascii/render_strategy edit the following file: ascii_strategy.py

add the following line after "import time": time.clock = time.time

This should solve the problem for playing the video.

zachmx commented 1 year ago

I think the solution will also work for Windows, so here is the solution for Unix:

folder: cd /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/video_to_ascii/render_strategy edit the following file: ascii_strategy.py

add the following line after "import time": time.clock = time.time

This should solve the problem for playing the video.

This fixed the problem for my system. running on linux (pop os).

the directory for that file in my system was located at ~/.local/lib/python3.10/site-packages/video_to_ascii/render_strategy

leaving this here in case anyone has problems finding the proper directory for the file on their system