conda-forge / keras-feedstock

A conda-smithy repository for keras.
BSD 3-Clause "New" or "Revised" License
6 stars 28 forks source link

Shell loading slow after installing Keras with Conda #45

Closed itamar-dw closed 1 month ago

itamar-dw commented 4 years ago

Issue: The Keras package installed using conda install -c conda-forge keras makes my shell loading very slow (4-5 seconds), the reason is that the module is imported during the env activation as seen by the following line from bash -x ~/.bashrc:

++ . /home/itamar/anaconda2/envs/drvpy37/etc/conda/activate.d/keras_activate.sh
++++ python /home/itamar/anaconda2/envs/drvpy37/etc/keras/load_config.py
+++ KERAS_BACKEND=tensorflow
+++ python -c 'import keras'

Is there a simple way to do the activation without importing the module? I am opening shells quite often while working
Environment (conda list):

``` # packages in environment at /home/itamar/anaconda2/envs/drvpy37: # # Name Version Build Channel _libgcc_mutex 0.1 main _tflow_select 2.3.0 mkl absl-py 0.8.1 py37_0 apptools 4.4.0 py37_1 asn1crypto 1.2.0 py37_0 astor 0.8.0 py37_0 attrs 19.3.0 py_0 backcall 0.1.0 py37_0 basemap 1.2.0 py37h705c2d8_0 anaconda binutils_impl_linux-64 2.33.1 he6710b0_7 binutils_linux-64 2.33.1 h9595d00_15 blas 1.0 mkl bleach 3.1.0 py37_0 boto 2.49.0 py37_0 boto3 1.9.234 py_0 botocore 1.12.234 py_0 bzip2 1.0.8 h7b6447c_0 c-ares 1.15.0 h7b6447c_1001 ca-certificates 2019.11.28 hecc5488_0 conda-forge certifi 2019.11.28 py37_0 conda-forge cffi 1.13.0 py37h2e261b9_0 cftime 1.0.4.2 py37hdd07704_0 chardet 3.0.4 py37_1003 colorlover 0.3.0 py_0 conda-forge configobj 5.0.6 py37_1 cpuonly 1.0 0 pytorch cryptography 2.8 py37h1ba5d50_0 curl 7.67.0 hbc83047_0 cycler 0.10.0 py37_0 dbus 1.13.12 h746ee38_0 decorator 4.4.0 py37_1 defusedxml 0.6.0 py_0 dill 0.3.1.1 py37_0 docutils 0.15.2 py37_0 entrypoints 0.3 py37_0 envisage 4.8.0 py_0 expat 2.2.6 he6710b0_0 fontconfig 2.13.0 h9420a91_0 freetype 2.9.1 h8a8886c_1 future 0.18.2 py37_0 gast 0.2.2 py37_0 gcc_impl_linux-64 7.3.0 habb00fd_1 gcc_linux-64 7.3.0 h553295d_15 geos 3.6.2 heeff764_2 glib 2.56.2 hd408876_0 gmp 6.1.2 h6c8ec71_1 google-pasta 0.1.8 py_0 gpxpy 1.3.5 py_0 conda-forge grpcio 1.16.1 py37hf8bcb03_1 gst-plugins-base 1.14.0 hbbd80ab_1 gstreamer 1.14.0 hb453b48_1 gxx_impl_linux-64 7.3.0 hdf63c60_1 gxx_linux-64 7.3.0 h553295d_15 h5py 2.9.0 py37h7918eee_0 hdf4 4.2.13 h3ca952b_2 hdf5 1.10.4 hb1b8bf9_0 icu 58.2 h9c2bf20_1 idna 2.8 py37_0 importlib_metadata 1.3.0 py37_0 intel-openmp 2019.4 243 ipykernel 5.1.3 py37h39e3cac_0 ipython 7.8.0 py37h39e3cac_0 ipython_genutils 0.2.0 py37_0 ipywidgets 7.5.1 py_0 jedi 0.15.1 py37_0 jinja2 2.10.3 py_0 jmespath 0.9.4 py_0 joblib 0.14.1 py_0 jpeg 9b h024ee3a_2 jsoncpp 1.8.4 hfd86e86_0 jsonlines 1.2.0 py_1 conda-forge jsonschema 3.2.0 py37_0 jupyter 1.0.0 py37_7 jupyter_client 5.3.4 py37_0 jupyter_console 6.0.0 py37_0 jupyter_contrib_core 0.3.3 py_2 conda-forge jupyter_contrib_nbextensions 0.5.1 py37_0 conda-forge jupyter_core 4.6.1 py37_0 jupyter_highlight_selected_word 0.2.0 py37_1000 conda-forge jupyter_latex_envs 1.4.4 py37_1000 conda-forge jupyter_nbextensions_configurator 0.4.1 py37_0 conda-forge keras 2.3.1 py37_0 conda-forge keras-applications 1.0.8 py_0 keras-preprocessing 1.1.0 py_1 kiwisolver 1.1.0 py37he6710b0_0 krb5 1.16.4 h173b8e3_0 ld_impl_linux-64 2.33.1 h53a641e_7 libcurl 7.67.0 h20c2e04_0 libedit 3.1.20181209 hc058e9b_0 libffi 3.2.1 hd88cf55_4 libgcc-ng 9.1.0 hdf63c60_0 libgfortran-ng 7.3.0 hdf63c60_0 libgpuarray 0.7.6 h14c3975_0 libmagic 5.36 h516909a_1 conda-forge libnetcdf 4.6.1 h11d0813_2 libogg 1.3.2 h7b6447c_0 libpng 1.6.37 hbc83047_0 libprotobuf 3.11.2 hd408876_0 libsodium 1.0.16 h1bed415_0 libssh2 1.8.2 h1ba5d50_0 libstdcxx-ng 9.1.0 hdf63c60_0 libtheora 1.1.1 h5ab3b9f_1 libtiff 4.1.0 h2733197_0 libuuid 1.0.3 h1bed415_2 libvorbis 1.3.6 h7b6447c_0 libxcb 1.13 h1bed415_1 libxml2 2.9.9 hea5a465_1 libxslt 1.1.33 h7d1a2b0_0 llvmlite 0.30.0 py37hd408876_0 lxml 4.4.2 py37hefd8a0e_0 lz4-c 1.8.1.2 h14c3975_0 mako 1.1.0 py_0 markdown 3.1.1 py37_0 markupsafe 1.1.1 py37h7b6447c_0 matplotlib 3.1.1 py37h5429711_0 mayavi 4.6.2 py37hcf37d21_4 mistune 0.8.4 py37h7b6447c_0 mkl 2019.4 243 mkl-service 2.3.0 py37he904b0f_0 mkl_fft 1.0.14 py37ha843d7b_0 mkl_random 1.1.0 py37hd6b4f25_0 more-itertools 8.0.2 py_0 multiprocess 0.70.9 py37h516909a_0 conda-forge nbconvert 5.6.1 py37_0 nbformat 4.4.0 py37_0 ncurses 6.1 he6710b0_1 netcdf4 1.4.2 py37h808af73_0 anaconda ninja 1.9.0 py37hfd86e86_0 nose 1.3.7 pypi_0 pypi notebook 6.0.2 py37_0 numba 0.46.0 py37h962f231_0 numpy 1.17.2 py37haad9e8e_0 numpy-base 1.17.2 py37hde5b4d6_0 olefile 0.46 py37_0 openssl 1.1.1d h516909a_0 conda-forge opt_einsum 3.1.0 py_0 packaging 19.2 py_0 pandas 0.25.2 py37he6710b0_0 pandoc 2.2.3.2 0 pandocfilters 1.4.2 py37_1 parso 0.5.1 py_0 pathos 0.2.5 py_0 conda-forge pcre 8.43 he6710b0_0 pexpect 4.7.0 py37_0 pickleshare 0.7.5 py37_0 pillow 6.2.1 py37h34e0f95_0 pip 19.3.1 py37_0 plotly 4.1.1 py_0 pluggy 0.13.1 pypi_0 pypi pox 0.2.7 py_0 conda-forge ppft 1.6.6.1 py37_0 conda-forge proj 6.2.1 haa6030c_0 prometheus_client 0.7.1 py_0 prompt_toolkit 2.0.10 py_0 protobuf 3.11.2 py37he6710b0_0 ptyprocess 0.6.0 py37_0 py 1.8.0 pypi_0 pypi py4j 0.10.7 py37_0 pycparser 2.19 py37_0 pyface 6.1.2 py37_0 pygments 2.4.2 py_0 pygpu 0.7.6 py37h035aef0_0 pymysql 0.9.3 py37_0 pyopenssl 19.0.0 py37_0 pyparsing 2.4.2 py_0 pyproj 2.4.1 py37h2ea87da_0 pyqt 5.9.2 py37h05f1152_2 pyrsistent 0.15.6 py37h7b6447c_0 pyshp 2.1.0 py_0 pysocks 1.7.1 py37_0 pyspark 2.4.4 py_0 pytest 5.3.1 pypi_0 pypi python 3.7.4 h265db76_1 python-dateutil 2.8.0 py37_0 python-magic 0.4.15 py37_1001 conda-forge pytorch 1.3.1 py3.7_cpu_0 [cpuonly] pytorch pytz 2019.3 py_0 pyyaml 5.2 py37h7b6447c_0 pyzmq 18.1.0 py37he6710b0_0 qt 5.9.7 h5867ecd_1 qtconsole 4.6.0 py_0 quaternion 2019.12.11.22.25.52 py37hc1659b7_0 conda-forge readline 7.0 h7b6447c_5 requests 2.22.0 py37_0 retrying 1.3.3 py37_2 s3transfer 0.2.1 py37_0 scikit-learn 0.22 py37hd81dba3_0 scipy 1.3.1 py37h7c811a0_0 send2trash 1.5.0 py37_0 setuptools 41.4.0 py37_0 sip 4.19.8 py37hf484d3e_0 six 1.12.0 py37_0 sqlalchemy 1.3.10 py37h7b6447c_0 sqlite 3.30.1 h7b6447c_0 tbb 2019.8 hfd86e86_0 tensorboard 2.0.0 pyhb38c66f_1 tensorflow 2.0.0 mkl_py37h66b46cc_0 tensorflow-base 2.0.0 mkl_py37h9204916_0 tensorflow-estimator 2.0.0 pyh2649769_0 termcolor 1.1.0 py37_1 terminado 0.8.3 py37_0 testpath 0.4.4 py_0 theano 1.0.4 py37hfd86e86_0 tk 8.6.8 hbc83047_0 torchvision 0.4.2 py37_cpu [cpuonly] pytorch tornado 6.0.3 py37h7b6447c_0 traitlets 4.3.3 py37_0 traits 5.2.0 py37h7b6447c_0 traitsui 6.1.3 py_0 ujson 1.35 py37h14c3975_0 urllib3 1.24.2 py37_0 vtk 8.2.0 py37haa4764d_200 wcwidth 0.1.7 py37_0 webencodings 0.5.1 py37_1 werkzeug 0.16.0 py_0 wheel 0.33.6 py37_0 widgetsnbextension 3.5.1 py37_0 wrapt 1.11.2 py37h7b6447c_0 xz 5.2.4 h14c3975_4 yaml 0.1.7 had09818_2 zeromq 4.3.1 he6710b0_3 zipp 0.6.0 py_0 zlib 1.2.11 h7b6447c_3 zstd 1.3.7 h0b5b093_0 ```


Details about conda and system ( conda info ):

``` active environment : drvpy37 active env location : /home/itamar/anaconda2/envs/drvpy37 shell level : 1 user config file : /home/itamar/.condarc populated config files : /home/itamar/.condarc conda version : 4.7.12 conda-build version : 3.17.6 python version : 2.7.16.final.0 virtual packages : base environment : /home/itamar/anaconda2 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/itamar/anaconda2/pkgs /home/itamar/.conda/pkgs envs directories : /home/itamar/anaconda2/envs /home/itamar/.conda/envs platform : linux-64 user-agent : conda/4.7.12 requests/2.19.1 CPython/2.7.16 Linux/5.0.0-37-generic ubuntu/18.04.3 glibc/2.27 UID:GID : 1000:1000 netrc file : None offline mode : False ```
ngam commented 6 months ago

I believe this is now resolved