Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
368 views
in Technique[技术] by (71.8m points)

python - Conda - Silently installing a package

I am trying to automate the process of setting up a development environment with pandas package using conda.

I installed conda, created and activated a dev environment. When I tried to install a package as follows, I noticed that there was a prompt to which a user had to key in Y or N (Proceed ([y]/n)?) for the installation to proceed successfully.

$ conda install pandas
Fetching package metadata: ....
Solving package specifications: ..................
Package plan for installation in environment /home/miniconda2/envs/pandas_env:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    libgfortran-1.0            |                0         170 KB
    openblas-0.2.14            |                3         3.5 MB
    numpy-1.10.2               |           py27_0         5.9 MB
    pytz-2015.7                |           py27_0         174 KB
    six-1.10.0                 |           py27_0          16 KB
    python-dateutil-2.4.2      |           py27_0         219 KB
    pandas-0.17.1              |      np110py27_0        12.4 MB
    ------------------------------------------------------------
                                           Total:        22.3 MB

The following NEW packages will be INSTALLED:

    libgfortran:     1.0-0             
    numpy:           1.10.2-py27_0     
    openblas:        0.2.14-3          
    pandas:          0.17.1-np110py27_0
    python-dateutil: 2.4.2-py27_0      
    pytz:            2015.7-py27_0     
    six:             1.10.0-py27_0     

Proceed ([y]/n)? y

Fetching packages ...
libgfortran-1. 100% |###################################################################################################################################################################| Time: 0:00:00 457.23 kB/s
openblas-0.2.1 100% |###################################################################################################################################################################| Time: 0:00:02   1.68 MB/s
numpy-1.10.2-p 100% |###################################################################################################################################################################| Time: 0:00:02   2.42 MB/s
pytz-2015.7-py 100% |###################################################################################################################################################################| Time: 0:00:00 388.35 kB/s
six-1.10.0-py2 100% |###################################################################################################################################################################| Time: 0:00:00 224.69 kB/s
python-dateuti 100% |###################################################################################################################################################################| Time: 0:00:00 493.15 kB/s
pandas-0.17.1- 100% |###################################################################################################################################################################| Time: 0:00:04   3.24 MB/s
Extracting packages ...
[      COMPLETE      ]|######################################################################################################################################################################################| 100%
Linking packages ...
[      COMPLETE      ]|######################################################################################################################################################################################| 100%

How can I override these prompts so that the installation takes place silently? I tried using the -f flag but it does not seem to be existing with the conda install command.

Thanks in advance!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Used $conda install -y pandas and it installed without any prompts (see documentation).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...