Permanently set Python path for Anaconda within Cygwin

后端 未结 8 1767
盖世英雄少女心
盖世英雄少女心 2020-12-13 06:32

I\'m trying to install Anaconda on my Windows 7 machine. I often use cygwin to for my command-line work, and I would like to manage Anaconda from there. I\'ve worked through

8条回答
  •  心在旅途
    2020-12-13 07:05

    To work with the interactive Python shell in Cygwin I use the -i option.

    To get it from the Anaconda install, I used the steps suggested above:

    $ export PATH=/cygdrive/c/anaconda:$PATH
    $ which python
    /cygdrive/c/anaconda/python
    

    Then I launch python within Cygwin with the -i option:

    $ python -i
    Python 2.7.8 |Anaconda 2.1.0 (64-bit)| (default, Jul  2 2014, 15:12:11) [MSC v.1500 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    Anaconda is brought to you by Continuum Analytics.
    Please check out: http://continuum.io/thanks and https://binstar.org
    >>>>
    

    The libraries are also working fine. For instance the pandas library (which has been installed through Anaconda) can be imported now.

    >>>> import pandas
    >>>> pandas.DataFrame
    
    

    Now to make this permanent I added the path in my bashrc file:

    $ echo 'export PATH=/cygdrive/c/anaconda:$PATH' >> .bashrc
    $ source .bashrc
    $ which python
    /cygdrive/c/anaconda/python
    

    I hope this helps.

提交回复
热议问题