-
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
make conda work with msysgit terminal or cygwin #747
Comments
On a side note: readline-based tools like ipython that get shipped with anaconda windows don't seem to work either |
OK, this is a little "ping" on this issue, with a suggestion that Windows includes an root=/$(conda info | grep 'root env' | cut -f 2- -d ':' | cut -f 1 -d '(' | tr -d ': ' | tr '\\' '/')
envdir=/$(conda info | grep 'envs dir' | cut -f 2- -d ':' | cut -f 1 -d '(' | tr -d ': ' | tr '\\' '/')
excised_path=$(echo $PATH | sed -e "s#:$envdir:#:#g; s#:$envdir/Scripts:#:#g")
export PATH=$envdir/$1:$envdir/Scripts:$excised_path
export PS1="($1) [\u@\h \W]\$ " I think that will work "well enough" |
If the msysgit activate script uses bash, can't we just reuse the existing activate script exactly? |
From my experience the last few days it looks like it will actually be more work than I initially suggested. One initial reason that the current script won't work is that programs aren't installed in the same directories. msysgit bash is pretty good. It would, I think, be a big value-add for our Windows distribution of Anaconda to include some suite of Unix tools (cygwin or msysgit), with appropriate activate scripts, and an environment where |
Would it be possible to have a bin/ directory that only gets added to the path on cygwin/msysgit? |
Maybe, but then what about everything that also exists in the "top" directory and in the "Scripts" directory? Are you suggesting that all 3 directories get added to the PATH? (top, Scripts, bin)? |
Yes, but bin should only be there for bash-like environments. |
Issue #843 is a sub-problem of getting Anaconda on Windows to play nicely with Cygwin or "git bash". |
OK, I understand what you're suggesting: from cygwin/msysgit, there would be 3 directories added to the path:
And then the "new" activate (and any other commands that need customization) goes into Sounds like a good plan. |
Isn't that issue a duplicate of this one? |
Ping on this. If you are on windows and need to use unix tools alongside your conda env then it would be ideal to be able to use conda inside the mingw/cygwin shells. |
Conda itself should work in cygwin if you have the Scripts dir on your PATH. There is no activate script, though. |
So how do you activate an environment if you are using the MinGW or Cygwin shell? |
activating an environment just puts that environment's directory and Scripts directory on the front of the PATH (it also sets |
This is the issue we have: http://stackoverflow.com/questions/24921682/how-to-use-conda-within-cygwin Should I instruct users to manually use the python in the environment, i.e. type the entire path to the python executable? |
I'm trying to write these instructions so that it works cross platform. Currently there are all kinds of issues with Windows but everything works smoothly on Linux/Mac. |
The simplest solution, if it works, is to recommend using the regular cmd shell on Windows. Otherwise, you can recommend using a full path. |
Ok, I'll recommend using the two shells, cmd for conda/python and MinGW/Cygwin for the unix commands. |
@csoja and @ilanschnell I've had some discussions with @stephenakearns and @mrduane about the importance of strong Windows support in Anaconda. I think we're on the same page with @teoliphant @pzwang, MattH and MicheleC. Anaconda (and by implication conda) working wonderfully perfectly in Windows, using Powershell, cygwin, and msysgit (or similar) would really be appreciated. |
+1 |
1 similar comment
+1 |
This functionality should be present in master as it stands now. We do not have a current release with this yet. It is slated for conda 4.1. |
@msarahan Oh great, thank! Do you happen to know if there are any guides to building anaconda from source around? |
@msarahan Oh, I see: it's pure python! Ok, I can a python build. Thanks again! |
Did this functionality make it into conda 4.1 then? I have 4.3 and |
+1, I have exactly same issue. When I try to activate an environment with |
+1, I'm having the same problem as @nirvana-msu and I'm using cygwin on Windows 10 x64. |
+1 Really wish I could use anaconda through git bash terminal. |
I added the following scripts to the bin folder of my bash shell: #!/usr/bin/bash
source $LOCALAPPDATA/Continuum/Anaconda3/Scripts/activate "$@" save this as I also made a path cleaner, saved in import os, sys
import logging
logging.basicConfig()
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
ANACONDA_LIB_PATH = os.path.expandvars(os.path.join('$LOCALAPPDATA', 'Continuum', 'Anaconda3', 'Library', 'bin')).lower()
LOGGER.debug(ANACONDA_LIB_PATH)
try:
sys.stdout.write(':'.join('/' + p[0].lower() + p[2:] for p in os.environ['PATH'].split(os.pathsep) if not p.lower().endswith(ANACONDA_LIB_PATH[2:])).replace('\\', '/'))
except Exception as err:
LOGGER.error(err)
sys.stdout.write('$PATH')
sys.exit(-1)
else:
sys.exit(0) which I use instead of deactivate here: #!/usr/bin/bash
source $LOCALAPPDATA/Continuum/anaconda3/Scripts/deactivate
export PATH=`$LOCALAPPDATA/Continuum/anaconda3/python.exe ~/bin/rm-anaconda-paths.py` saved as Never use in a conda-env that has any of the msys channel packages, or path clash hell will ensue. Also, after installing with conda in bash, I have an issue that suddenly bash can't find it anymore and I have to deactivate and re-activate again. 😦 |
Conda 4.4 should now be compatible with hot bash. Is anybody actually having problems with recent versions of conda 4.4? |
I tried to update, but it broke my anaconda, so I downgraded. I'm using 4.3.31 now:
see this comment |
I found this thread when trying to get Cygwin working for conda environment (conda v4.5) when I found in the changelog for v4.4 the answer on how to get it to work which solved the problem for me. Oddly the official documentation has not been updated with this: |
I can confirm that conda and cygwin still can't play nicely as of the most recent versions of each. When I attempted, I got the results described here: #7742 The fix referenced by rsheftel above did not fix things for me. |
Conda well never work very well on Cygwin because Cygwin does not care about interoperation with 'native' Windows software. In fact this is the reason msys was created. I wouldn't recommend using that now-a-days since MSYS2 is available and actually maintained. If you want basic Cygwin support please submit PRs for this. Conda does support MSYS2 and I will endeavor to make sure this support is maintained as best I can. This MSYS2 support shows what would need to be done to support Cygwin. |
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. |
The bash shell provided with msysgit (http://msysgit.github.io) or with Cygwin are very useful for people on Windows looking for something more useful than cmd.exe or PowerShell.
However, it appears that at least some of the standard conda commands won't work in this environment (probably not surprisingly), e.g. "activate", since .bat file modification of cmd.exe environment is doubtless different from what a bash shell expects.
It would be nice if this worked. Perhaps just bundling msysgit with Anaconda for Windows would be a good way to provide a "full solution".
The text was updated successfully, but these errors were encountered: