18

I have Win 7 with Cygwin installed. The cygwin has its own Python 2.7 interpreter. I have installed Miniconda separately for Win 7 (not for Cygwin, not sure if i have to).

So, the thing is I am able to create a new env from cygwin, and able to activate it. However, the activation doesn't seem to do anything??

ambarik@AMBARIK-WS01 ~
$ conda create -n cce python
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment C:\Miniconda\envs\cce:

The following packages will be linked:

    package                    |            build
    ---------------------------|-----------------
    python-2.7.8               |                0   hard-link

Proceed ([y]/n)? y

Linking packages ...
[      COMPLETE      ] |#################################################| 100%
#
# To activate this environment, use:
# > activate cce
#

ambarik@AMBARIK-WS01 ~
$ activate cce
-bash: activate: command not found

ambarik@AMBARIK-WS01 ~
$ /cygdrive/c/Miniconda/Scripts/activate.bat cce
Activating environment "cce"...

ambarik@AMBARIK-WS01 ~
$ which python
/usr/bin/python

How can i use conda within cygwin to install a python package?

UPDATE1: I understand that I manually change the python path to the conda/python/ like described here Installing anaconda to use with windows, but i was looking to see if there are other ways, other than manually modifying the path

UPDATE2: I am trying to actually install pexpect. I realized that the python that gets installed through cygwin comes with resource.dll. However, Python that gets installed via MiniConda doesn't come with it.

Community
  • 1
  • 1
amulllb
  • 3,036
  • 7
  • 50
  • 87
  • i think the solution could be somewhat like https://stackoverflow.com/questions/36969824/using-anaconda-environments-with-cygwin-on-windows, especially if your cygwin have precedence over windows binaries in the PATH. Yet my desire is to have it in some more simple way. – WebComer Apr 16 '18 at 00:47

3 Answers3

3

This will be fixed with the Conda 4.1 release. Keep an eye out - coming soon.

msarahan
  • 1,081
  • 9
  • 20
  • 3
    Just trying with Miniconda 4.3.11. `source activate` works, but it sets the CONDA_PREFIX and correspondingly some directories in PATH to `/C/...` rather than `/cygdrive/c/...`. – Roland Weber Mar 06 '17 at 09:04
1

Cygwin will probably work with the Unix activate and deactivate scripts. Try putting them in Anaconda\Scripts and use source activate envname and source deactivate.

asmeurer
  • 86,894
  • 26
  • 169
  • 240
  • 1
    This doesn't seem to work. As I don't as I get the following expected error `Error: no such directory: C:\Miniconda\envs\testenv\bin`. I am going to try to install the linux version of conda in cygwin, not sure how though?! – amulllb Aug 01 '14 at 21:08
  • Installing the Linux version of conda into cygwin will not work, because the binaries themselves still need to be compiled for Windows. – asmeurer Aug 01 '14 at 21:17
  • Yes, i just tried it from the cygwin shell running `$ ./Miniconda-3.5.5-Linux-x86.sh` and i get error `cannot execute native linux-32 binary, output from 'uname -a' is: CYGWIN_NT-6.1-WOW64 AMBARIK-WS01 1.7.30(0.272/5/3) 2014-05-23 10:36 i686 Cygwin`. Is there any other way? – amulllb Aug 01 '14 at 21:19
1

Another option is to use the cmd shell, where activate does work. You'll need to make sure to add cygwin to your PATH, though.

asmeurer
  • 86,894
  • 26
  • 169
  • 240