Comments (8)
I don't use Windows so can't diagnose this. Feel free to send a PR though.
from doitlive.
Full error
ashis@g33k:Desktop $ @echo off
Traceback (most recent call last):
File "c:\python3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\python3\Scripts\doitlive.exe\__main__.py", line 9, in <module>
File "c:\python3\lib\site-packages\click\core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "c:\python3\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "c:\python3\lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\python3\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\python3\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\python3\lib\site-packages\doitlive\cli.py", line 329, in play
commentecho=commentecho)
File "c:\python3\lib\site-packages\doitlive\cli.py", line 189, in run
magicrun(command, **state)
File "c:\python3\lib\site-packages\doitlive\keyboard.py", line 131, in magicrun
extra_commands=extra_commands, test_mode=test_mode)
File "c:\python3\lib\site-packages\doitlive\keyboard.py", line 119, in run_command
return subprocess.call([shell, fp.name])
File "c:\python3\lib\subprocess.py", line 323, in call
with Popen(*popenargs, **kwargs) as p:
File "c:\python3\lib\subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "c:\python3\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
from doitlive.
Hey @arthuro555, I just got the same issue running on Windows 10. If you look at the traceback you can see the error occurs on line 119 in keyboard.py
:
File "c:\python3\lib\site-packages\doitlive\keyboard.py", line 119, in run_command return subprocess.call([shell, fp.name])
If you inspect the shell
variable it seems to be equal to bin/bash
. Obviously bash is not available out-of-the-box on Windows, but since you are using GitHub I assume you have git installed on your machine. Apparently, all you need to do is overwrite this shell
value with your actual bash.exe
path.
To resolve the issue I imported the sys
module and added the following condition at the top of the run_command
function in the keyboard.py
file,
import sys
...
if sys.platform == "win32":
... # use the path to your bash.exe file here
... shell = "C:/Program Files/Git/usr/bin/bash.exe"
After that fix, I was able to use the doitlive play
and doitlive record
commands with no issues.
Hope this helps 😉
from doitlive.
You can set the shell within your session script, at the top of the file:
#doitlive shell: C:/Program Files/Git/usr/bin/bash.exe
from doitlive.
I tried to set the --shell
flag directly from the command line but it didn't work (see documentation examples),
❌ doitlive play session.sh --shell "C:\Program Files\Git\usr\bin\bash.exe"
I also tried to set a #doitlive shell
comment within the session.sh
file (as @sloria mentioned) and it worked just fine 👌 (see documentation configuration),
✔ #doitlive shell: C:/Program Files/Git/usr/bin/bash.exe
Thanks for the tip.
from doitlive.
Correction from my previous post.
The program operates correctly after removing the comment
#doitlive shell: /bin/bash
from the session.sh
file and issuing the following command,
✔ doitlive play session.sh --shell "C:\Program Files\Git\usr\bin\bash.exe"
So it seems the file comment #doitlive shell:
has higher precedence than the --shell
argument. I think this might be an undesirable effect, most command-line tools are designed to overwrite sensible defaults if command-line arguments are provided. But of course, that is just a personal opinion.
Nonetheless, thank you @sloria for sharing this beautiful and yet amusing package.
from doitlive.
So it seems the file comment #doitlive shell: has higher precedence than the --shell argument.
Woops, that's not intentional. I agree --shell
should take precedence. PRs welcome to fix that.
Thanks for the kind words!
from doitlive.
Closing this for now; see workaround above to set your shell on Windows.
from doitlive.
Related Issues (20)
- provide stealth mode allowing to pause and resume scenario silently HOT 4
- Xonsh support? HOT 1
- function not found in dotilive playbback session HOT 1
- Actually typing comments?
- Add option to not exit with esc HOT 2
- Pausing/typing whole lines HOT 1
- Unable to activate a conda environment during recording HOT 7
- Staircase on background commands
- bugs in <tab> editing mode HOT 1
- Document Ctrl-C and Ctrl-Z behavior and prompt themes HOT 1
- Small typo in doitlive/termutils.py
- setup.py records the full python path HOT 4
- doitlive doesn't run on stock CentOS 7 HOT 5
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- Drop support for Python 2 HOT 2
- Issue with python 3.9 and ipython shell HOT 4
- Handle Ctrl-L so we don't have to use `clear` all the time HOT 3
- Re-design the keyboard module
- Using \ for line-break exits doitlive
- Start/End of script
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doitlive.