asciinema/asciinema

Error when attempting to run using Ubuntu 22.04 with Pip 22.0.2 / Python 3.10

StewAlexander-com opened this issue · 3 comments

I installed it and tried to run, and it came back with permission error

stew@stew /> sudo apt install ascicinema
[sudo] password for stew: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package ascicinema
stew@stew / [100]> pip3 install asciinema
Defaulting to user installation because normal site-packages is not writeable
Collecting asciinema
  Downloading asciinema-2.2.0-py3-none-any.whl (92 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━ 92.5/92.5 KB 558.2 kB/s eta 0:00:00
Installing collected packages: asciinema
Successfully installed asciinema-2.2.0
stew@stew /> asciinema rec first.cast
asciinema: recording asciicast to first.cast
asciinema: press <ctrl-d> or type "exit" when you're done
Process Process-2:
                  Traceback (most recent call last):
                                                      File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
      self.run()
                  File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
                            self._target(*self._args, **self._kwargs)
      File "/home/stew/.local/lib/python3.10/site-packages/asciinema/recorder.py", line 141, in run
                                      with self.writer as w:
                                                              File "/home/stew/.local/lib/python3.10/site-packages/asciinema/asciicast/v2.py", line 126, in __enter__
                                       self._open_file()
                                                          File "/home/stew/.local/lib/python3.10/site-packages/asciinema/asciicast/v2.py", line 156, in _open_file
                                    self.file = open(
                                                     PermissionError: [Errno 13] Permission denied: 'first.cast'
                                               Traceback (most recent call last):
  File "/home/stew/.local/bin/asciinema", line 8, in <module>
    sys.exit(main())
  File "/home/stew/.local/lib/python3.10/site-packages/asciinema/__main__.py", line 215, in main
    code = command.execute()
  File "/home/stew/.local/lib/python3.10/site-packages/asciinema/commands/record.py", line 106, in execute
    recorder.record(
  File "/home/stew/.local/lib/python3.10/site-packages/asciinema/recorder.py", line 61, in record
    with async_writer(sync_writer, time_offset, record_stdin) as _writer:
  File "/home/stew/.local/lib/python3.10/site-packages/asciinema/async_worker.py", line 35, in __exit__
    raise RuntimeError(
RuntimeError: worker process exited with code 1

Attempting to use sudo did not work because it cannot find the pip app

stew@stew / [1]> sudo asciinema rec first.cast
sudo: asciinema: command not found

Output of pip

stew@stew / [127]> pip3 --version
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
stew@stew /> 
  • Ubuntu 22.04 LTS
ku1ik commented

From stack trace it look like write permission error. It's not issue with asciinema, the error output is ugly though, needs improvement. This is related to #543.