Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Wolfyxon opened this issue Apr 30, 2021 · 11 comments
Open

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

Wolfyxon opened this issue Apr 30, 2021 · 11 comments
Labels
bug Something isn't working

Comments

@Wolfyxon
Copy link

Wolfyxon commented Apr 30, 2021

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):

  • OS: Windows 10
  • Browser: N/A
  • Version: 1.2.9
@joelibaceta joelibaceta added the bug Something isn't working label May 2, 2021
@RajvirSingh1313
Copy link

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

@frankrx41
Copy link

+1
My py version is 3.9.5

@ziposcar
Copy link

+1
3.9.2

@yusufusta
Copy link

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

@RajvirSingh1313
Copy link

Thanks Alot, gona make some cool projects with it

@Indhar01
Copy link

upgrade your sqlalchemy
pip install sqlalchemy --upgrade

@waipeinan
Copy link

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
Copy link

+1
3.10.2

@RedDragonTix
Copy link

same here on 3.10

@Traiver
Copy link

Traiver commented Nov 12, 2022

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
Copy link

zachmx commented May 30, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests