Comments (21)
Thanks for reporting, I have no way of running the builder on Windows but I'll look into how shutil.which
works on that platform when I find the time. Let me know if you find out anything yourself.
from base16-builder-python.
Okay, I'm not sure how executable lookup works in the Win command shell but as a starting point could you check what paths os.getenv(PATH)
produces and check whether or not the git executable is actually in one of those places?
I guess we could just use an EAFP approach with Popen but since there are a lot of threads running git in parallel, I feel it's safer to find out where git is and make sure it's present before running those threads.
from base16-builder-python.
@cafeclimber ping
from base16-builder-python.
Hey sorry for the slow response. running os.getenv('PATH')
shows C:\\Program Files\\Git\\cmd
Running where git
shows the above path followed by git.exe
from base16-builder-python.
This is probably related to #11. updater.py
calls Popen()
with the env
argument, which per subprocess.py:
If env is not None, it must be a mapping that defines the environment variables for the new process; these are used instead of the default behavior of inheriting the current processโ environment.
Unfortunately, updater.py
was setting only one key in the environment passed to Popen()
. #12 fixes this by copying the current environment and adding the key required by updater.py
.
from base16-builder-python.
Merged #12 . Let me know if you're still having issues.
from base16-builder-python.
@cafeclimber could you let me know if you're still having issues? Otherwise, I'd like to push the new version to pip.
from base16-builder-python.
Still the same issue :/ Git executable not found in path
from base16-builder-python.
Okay. So further investigation required. ๐ถ This might be a dumb question, but did you use the latest commit from master?
from base16-builder-python.
Haha totally fair question. I did a fresh git clone and got the results I did. If that isn't the latest commit, then I'm a dingus
from base16-builder-python.
Aaaaah... sorry for the late reply. So here's some other ideas, could you run these in the interpreter?
os.getenv('PATHEXT')
platform.architecture()
platform.architecture('C:\\Program Files\\Git\\cmd\\git.exe')
from base16-builder-python.
Sure thing. Here's the output:
>>> os.getenv('PATHEXT')
'.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;'
>>> platform.architecture()
('32bit', 'WindowsPE')
>>> platform.architecture('C:\\Program Files\\Git\\cmd\\git.exe')
('32bit', '')
from base16-builder-python.
Okay, so your Python executable is 32bit. Is your version of Windows the same? Also, could you check the path you passed to platform.architecture()
? The fact that the second element of the tuple is an empty string probably indicates that there is no file at that location.
from base16-builder-python.
No it's 64 bit windows. I check on that path and it seems okay. I get that result for a number of different programs. I navigated to that path in file explorer, and the file is there. I tried navigating to that directory in cmd then running the interpreter and doing platform.architecture()
and got the same result. I imported os and used abspath()
to make sure the path was correct and it was. :/
This version of python was installed by virtualenv-wrapper so I'm not sure if that's why it's 32-bit?
from base16-builder-python.
Virtualenv shouldn't isolate your Python environment from system binaries so that's probably not the cause, though I can't be sure. Is it possible for you to install a standard 64bit Python distribution and check again?
If that doesn't change anything, I'm pretty much out of ideas. You could open an issue on the offical Python tracker and ask why shutil.which isn't able to see git. I'd be very interested in the reason for that as well.
from base16-builder-python.
So I'm a total idiot and don't know why I didn't think of it before, but running shutil.which('git.exe')
instead of shutil.which('git')
succeeds
from base16-builder-python.
That shouldn't be an issue though because shutil.which
is supposed to take in account the PATHEXT environment variable (as described in the docs. Your previous post shows that .EXE is part of that variable.
from base16-builder-python.
Okay, so this is what I think is happening here: You're using a 32bit version of Python but a 64bit version of git. 32bit Python automatically translates 'Program Files' to 'Program Files (x86)' and doesn't find the git executable there. At least that's what shutil.which seems to be doing, no idea why the program is visible to Popen. We could implement a workaround by appending '.exe' to the executable name in Windows but that seems very hacky to me. Also, until we make sure that this is unintended behaviour, I feel that if git isn't accessible by shutil.which it shouldn't be accessible to the builder as well.
from base16-builder-python.
No no I uninstalled my 32 bit version of Python and installed a 64 bit and retried everything. I see that in the docs though and it's weird it doesn't find it. It does the same thing for any program I try...
I'll ask a question on SO and see if I can get anything
from base16-builder-python.
@cafeclimber Any news?
from base16-builder-python.
Closing for now.
from base16-builder-python.
Related Issues (16)
- Single Color Scheme HOT 1
- update doesn't respect shell environment
- "inject -s" syntax doesn't match "build -s" syntax HOT 5
- Correct Readme HOT 3
- Update to base16 0.9.1 HOT 8
- Return non-zero code on an error HOT 6
- pybase16 update prompts for Github credentials HOT 4
- distinguish between missing templates and schemes HOT 2
- Python <3.6 compatibility HOT 4
- PyPI Request: Update HOT 1
- Licensing Question HOT 1
- If a template doesn't provide a file extension the output file names have None appended HOT 1
- Failed to Update HOT 3
- Bad characters \u2026
- Workflow: How to ? HOT 4
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 base16-builder-python.