-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cannot run conda 4.4 in a batch script #6553
Comments
Ok, this is all then related to something we've done in https://github.com/conda/conda/blob/1a3353accd4b782835b9736627f890337ff488c1/conda/shell/Library/bin/conda.bat On Windows for conda 4.4, what you get when you type the command |
We probably need to add a lot of
checks to that file. |
Windows shell Instead of
you now need to use
otherwise the 2nd line will not be run anymore. |
What if, instead, your bat script was
Is that a possible fix? I realize, if it is a fix, it does require a change to existing code that was relying on old behavior. I'm afraid we might be stuck here with a solution like that though. |
Yes, that works, but the rest of conda.bat is not run. Isn't that a problem? |
Would conda be supporting using the activate.bat script in the future? If so, calling the activate script and then running conda.exe is okay |
We want to get rid of the
The answer is, it depends. For now, using |
Maybe we could add something like @call :run
@goto :eof
:run at the top of |
I'm not sure about the exit status propagation for this, though... |
I was hoping you might have some ideas here @mbargull :) |
nvm, thinking about it, it is exactly as @isuruf said
So I'm not sure we can use a batch file-only solution if we want to make |
We're probably just stuck with the constraints of batch scripting and cmd.exe. Eventually when we have the conda.bat pattern more broadly established, maybe we can just switch everybody writing batch scripts to use |
Yeah, I can't come up with a solution which supports the non- |
Lots of packages require that I guess we could consider moving def _get_path_dirs(self, prefix):
if on_win: # pragma: unix no cover
yield prefix.rstrip("\\")
yield join(prefix, 'Library', 'mingw-w64', 'bin')
yield join(prefix, 'Library', 'usr', 'bin')
yield join(prefix, 'Library', 'bin')
yield join(prefix, 'Scripts')
yield join(prefix, 'bin')
else:
yield join(prefix, 'bin') That set of paths for activate now is pretty set in stone. Those assumptions are baked into a bunch of existing conda packages. |
Ah, I just didn't look at the install scripts and thus didn't notice |
Well Powershell is deprecating cmd so I wonder if we shouldn't just do the best we can there (I know nothing about Powershell though) and support only using call for cmd? |
All the other shell wrappers are working out pretty well I think. Even the Actually, the only wrapper that's still pending to go into 4.4 is the powershell one. I have NO experience there though, and really don't know the best practices "powershell way" on how to implement that. At least there are plenty of examples now in the |
Of course, I agree you should
as soon as possible since I think the more unified shell handling with the wrappers, including |
I just installed powershell on my mac. 😱
Yes, they changed the executable name for unix from what it is on Windows. Microsoft maybe just won't ever learn. |
Maybe this should go in another issue, but note that you'll run into trouble updating |
Add tox, travis and appveyor environments for variations with and without lxml. Since we use either the integrated XML parsing of Python or the one provided by the 'lxml' library, it is best to run our tests in both setups. Especially since lxml supports additional functionality, so we have to make sure not to rely on this in the code. OWSLib has a similar testing environment. Also: use conda.exe to avoid issues with the new conda.bat See conda/conda#6527 and conda/conda#6553
I actually think we have this problem all the time now. We've tried to deal with it multiple times in multiple ways, and where we are right now with it is #6631. Trying again to address the issue in #6660, but I've sunk a lot of time into that and still haven't been successful yet. |
I think it's safe to close this issue now. Let me know if anyone disagrees. |
Otherwise, since conda is a .bat script itself, the invoking .bat script will exit after conda. See: conda/conda#6553
Otherwise, since conda is a .bat script itself, the invoking .bat script will exit after conda. See: conda/conda#6553
Otherwise, since conda is a .bat script itself, the invoking .bat script will exit after conda. See: conda/conda#6553
Otherwise, since conda is a .bat script itself, the invoking .bat script will exit after conda. See: conda/conda#6553
Otherwise, since conda is a .bat script itself, the invoking .bat script will exit after conda. See: conda/conda#6553
Otherwise, since conda is a .bat script itself, the invoking .bat script will exit after conda. See: conda/conda#6553
Otherwise, since conda is a .bat script itself, the invoking .bat script will exit after conda. See: conda/conda#6553
Otherwise, since conda is a .bat script itself, the invoking .bat script will exit after conda. See: conda/conda#6553
Otherwise, since conda is a .bat script itself, the invoking .bat script will exit after conda. See: conda/conda#6553
This really should be documented somewhere. It took me hours to figure out I have to put "call" in front of conda, otherwise the rest of the file is not executed. |
I want to share my scripts between Windows and Linux and this issue is breaking it. I hope conda.bat can be eliminated and conda.exe itself executes all necessary code so this hack is not needed. |
Well that's conda for you; you may want to try MSYS2 if you want to get things done. |
Hi there, thank you for your contribution to Conda! This issue has been automatically locked since it has not had recent activity after it was closed. Please open a new issue if needed. |
For example if I run a .bat file with
then only the first line is executed.
cc @kalefranz, this is the reason for the error @jdblischak mentioned in #6527
The text was updated successfully, but these errors were encountered: