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

nbstripout --install fails in Windows Command Prompt #61

Closed
bdforbes opened this issue Jul 30, 2017 · 6 comments
Closed

nbstripout --install fails in Windows Command Prompt #61

bdforbes opened this issue Jul 30, 2017 · 6 comments

Comments

@bdforbes
Copy link
Contributor

I'm running Enthought Canopy Python on Windows 10, and when running nbstripout --install on a newly created git repo, I'm getting the following error:

Traceback (most recent call last):
  File "C:\Users\bdforbes\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.5.5.3123.win-x86_64\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Users\bdforbes\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.5.5.3123.win-x86_64\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "c:\users\bdforbes\appdata\local\enthought\canopy\user\scripts\nbstripout.exe\__main__.py", line 9, in <module>
  File "c:\users\bdforbes\appdata\local\enthought\canopy\user\lib\site-packages\nbstripout.py", line 254, in main
    sys.exit(install(args.attributes))
  File "c:\users\bdforbes\appdata\local\enthought\canopy\user\lib\site-packages\nbstripout.py", line 160, in install
    git_dir = check_output(['git', 'rev-parse', '--git-dir']).strip()
  File "C:\Users\bdforbes\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.5.5.3123.win-x86_64\lib\subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "C:\Users\bdforbes\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.5.5.3123.win-x86_64\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "C:\Users\bdforbes\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.5.5.3123.win-x86_64\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

Everything works fine in the MINGW64 git bash terminal that is installed with git on Windows. This may be an issue for people who use the Windows Command Prompt for their git work and would like to use this helpful package.

Reference:

https://stackoverflow.com/a/35670418/336001

@kynan
Copy link
Owner

kynan commented Jul 30, 2017

Seems the git executable cannot be found. Can you run git commands in your command prompt?

@bdforbes
Copy link
Contributor Author

No I cannot... I didn't put them on the Windows path, since I always use the MINGW64 terminal for git. In this instance however, I instinctively went for a Windows Command Prompt to pip install nbstripout, and since I was already there I ran the nbstripout --install immediately after. Maybe the exception should be caught with a suitable warning about having git on the path?

@kynan
Copy link
Owner

kynan commented Jul 30, 2017

Yes, thanks for the pull request. Your fix will go in the 0.3.1 release.

@bdforbes
Copy link
Contributor Author

My pleasure.

@kynan
Copy link
Owner

kynan commented Jul 30, 2017

@bdforbes 0.3.1 is out! Can we close this?

@bdforbes
Copy link
Contributor Author

Thanks @kynan, I've updated from PyPI and verified that it catches the exception now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants