2
$\begingroup$

I am trying to get the bioinformatics tool deepbgc up and running. Now I have created a conda environment and have currently installed deepbgc onto it. Now when I run the tool, the program works but it outputs the following warning message as a result:

 /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/sklearn/base.py:306:
 UserWarning: Trying to unpickle estimator RandomForestClassifier from version 0.18.2 
 when using version 0.21.3. This might lead to breaking code or invalid results. Use at your own risk.  

This led me to believe that the program is trying to utilize an older version of the scikit-learn package (version 0.18.2 instead of the currently installed 0.21.3 version) for this RandomForestClassifer estimator. This pointed me to the next logical solution of downgrading my current version of scikit-learn. So, I ran a simple pip install of the older package version:

pip install scikit-learn==0.18.2

For some reason, the package downgrade failed and outputted the following error:

    error: Command "g++ -pthread -B /EFS/tools/miniconda/envs/deepbgc2/compiler_compat -
Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -
I/EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/numpy/core/include -
I/EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/numpy/core/include -
I/EFS/tools/miniconda/envs/deepbgc2/include/python3.7m -c 
sklearn/cluster/_dbscan_inner.cpp -o build/temp.linux-x86_64-cpython-
37/sklearn/cluster/_dbscan_inner.o -MMD -MF build/temp.linux-x86_64-cpython-
37/sklearn/cluster/_dbscan_inner.o.d" failed with exit status 1

      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  WARNING: No metadata found in /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages
  Rolling back uninstall of scikit-learn
  Moving to /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/scikit_learn-0.21.3.dist-info/
   from /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/~cikit_learn-0.21.3.dist-info
  Moving to /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/sklearn/
   from /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/~klearn
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> scikit-learn

note: This is an issue with the package mentioned above, not `pip`.

Currently, I have Python version 3.7 installed on the environment and version 22.1.2 of pip. Any guidance appreciated, thanks!

$\endgroup$

1 Answer 1

1
$\begingroup$

pip and conda don't mix and good advice is don't ever mix them. Thus to avoid this delete your old environment, create a new conda environment, or use a conda environment where pip has not been used ...

conda install -c anaconda scikit-learn=0.18.2 

If you are using pip it is recommended to use it only with virtualenv venv. If there is a dependency issue delete the environment and start over is much easier.

The rationale is for not mixing them is:

  • conda installs lots of stuff not just Python and it gets the env (environment) right for this purpose
  • pip only installs Python within a Python environment

The simple answer is

conda install -c bioconda deepbgc

conda will then install the correct version of scikit-learn automatically. If doing this it important it is in its own (new) conda environment however.

If the above doesn't work further stuff can be done, but the 'simple answer' should work.


@Joe_G says its hanging ... on solving environment just leave it ... you will then see why,

The following NEW packages will be INSTALLED:

  _tflow_select      pkgs/main/osx-64::_tflow_select-2.3.0-mkl
  absl-py            pkgs/main/noarch::absl-py-0.15.0-pyhd3eb1b0_0
  appdirs            pkgs/main/noarch::appdirs-1.4.4-pyhd3eb1b0_0
  astor              pkgs/main/osx-64::astor-0.8.1-py37hecd8cb5_0
  biopython          pkgs/main/osx-64::biopython-1.76-py37h1de35cc_0
  blas               pkgs/main/osx-64::blas-1.0-mkl
  bottleneck         pkgs/main/osx-64::bottleneck-1.3.5-py37h67323c0_0
  brotli             pkgs/main/osx-64::brotli-1.0.9-hca72f7f_7
  brotli-bin         pkgs/main/osx-64::brotli-bin-1.0.9-hca72f7f_7
  c-ares             pkgs/main/osx-64::c-ares-1.18.1-hca72f7f_0
  ca-certificates    pkgs/main/osx-64::ca-certificates-2022.07.19-hecd8cb5_0
  certifi            pkgs/main/osx-64::certifi-2022.9.14-py37hecd8cb5_0
  cycler             pkgs/main/noarch::cycler-0.11.0-pyhd3eb1b0_0
  dataclasses        pkgs/main/noarch::dataclasses-0.8-pyh6d0b6a4_7
  deepbgc            bioconda/noarch::deepbgc-0.1.23-py_0
  fftw               pkgs/main/osx-64::fftw-3.3.9-h9ed2024_1
  fonttools          pkgs/main/noarch::fonttools-4.25.0-pyhd3eb1b0_0
  freetype           pkgs/main/osx-64::freetype-2.11.0-hd8bbffd_0
  gast               pkgs/main/noarch::gast-0.5.3-pyhd3eb1b0_0
  giflib             pkgs/main/osx-64::giflib-5.2.1-haf1e3a3_0
  grpcio             pkgs/main/osx-64::grpcio-1.42.0-py37ha29bfda_0
  h5py               pkgs/main/osx-64::h5py-3.7.0-py37h4a1dd59_0
  hdf5               pkgs/main/osx-64::hdf5-1.10.6-h10fe05b_1
  hmmer              bioconda/osx-64::hmmer-3.3.2-h9722bc1_2
  importlib-metadata pkgs/main/osx-64::importlib-metadata-4.11.3-py37hecd8cb5_0
  intel-openmp       pkgs/main/osx-64::intel-openmp-2021.4.0-hecd8cb5_3538
  joblib             pkgs/main/noarch::joblib-1.1.0-pyhd3eb1b0_0
  jpeg               pkgs/main/osx-64::jpeg-9e-hca72f7f_0
  keras              pkgs/main/osx-64::keras-2.2.4-0
  keras-applications pkgs/main/noarch::keras-applications-1.0.8-py_1
  keras-base         pkgs/main/osx-64::keras-base-2.2.4-py37_0
  keras-preprocessi~ pkgs/main/noarch::keras-preprocessing-1.1.2-pyhd3eb1b0_0
  kiwisolver         pkgs/main/osx-64::kiwisolver-1.4.2-py37he9d5cce_0
  lcms2              pkgs/main/osx-64::lcms2-2.12-hf1fd2bf_0
  lerc               pkgs/main/osx-64::lerc-3.0-he9d5cce_0
  libbrotlicommon    pkgs/main/osx-64::libbrotlicommon-1.0.9-hca72f7f_7
  libbrotlidec       pkgs/main/osx-64::libbrotlidec-1.0.9-hca72f7f_7
  libbrotlienc       pkgs/main/osx-64::libbrotlienc-1.0.9-hca72f7f_7
  libcxx             pkgs/main/osx-64::libcxx-14.0.6-h9765a3e_0
  libdeflate         pkgs/main/osx-64::libdeflate-1.8-h9ed2024_5
  libffi             bioconda/osx-64::libffi-3.2.1-1
  libgfortran        pkgs/main/osx-64::libgfortran-5.0.0-11_2_0_h246ff09_26
  libgfortran5       pkgs/main/osx-64::libgfortran5-11.2.0-h246ff09_26
  libpng             pkgs/main/osx-64::libpng-1.6.37-ha441bb4_0
  libprotobuf        pkgs/main/osx-64::libprotobuf-3.20.1-h8346a28_0
  libtiff            pkgs/main/osx-64::libtiff-4.4.0-h2ef1027_0
  libwebp            pkgs/main/osx-64::libwebp-1.2.2-h56c3ce4_0
  libwebp-base       pkgs/main/osx-64::libwebp-base-1.2.2-hca72f7f_0
  llvm-openmp        pkgs/main/osx-64::llvm-openmp-14.0.6-h0dcd299_0
  lz4-c              pkgs/main/osx-64::lz4-c-1.9.3-h23ab428_1
  markdown           pkgs/main/osx-64::markdown-3.3.4-py37hecd8cb5_0
  matplotlib-base    pkgs/main/osx-64::matplotlib-base-3.5.2-py37hfb0c5b7_0
  mkl                pkgs/main/osx-64::mkl-2021.4.0-hecd8cb5_637
  mkl-service        pkgs/main/osx-64::mkl-service-2.4.0-py37h9ed2024_0
  mkl_fft            pkgs/main/osx-64::mkl_fft-1.3.1-py37h4ab4a9b_0
  mkl_random         pkgs/main/osx-64::mkl_random-1.2.2-py37hb2f4e1b_0
  munkres            bioconda/noarch::munkres-1.0.7-py_1
  ncurses            pkgs/main/osx-64::ncurses-6.3-hca72f7f_3
  numexpr            pkgs/main/osx-64::numexpr-2.8.3-py37h2e5f0a9_0
  numpy              pkgs/main/osx-64::numpy-1.21.5-py37h2e5f0a9_3
  numpy-base         pkgs/main/osx-64::numpy-base-1.21.5-py37h3b1a694_3
  openssl            pkgs/main/osx-64::openssl-1.1.1q-hca72f7f_0
  packaging          pkgs/main/noarch::packaging-21.3-pyhd3eb1b0_0
  pandas             pkgs/main/osx-64::pandas-1.3.5-py37h743cdd8_0
  pillow             pkgs/main/osx-64::pillow-9.2.0-py37hde71d04_1
  pip                pkgs/main/osx-64::pip-22.2.2-py37hecd8cb5_0
  prodigal           bioconda/osx-64::prodigal-2.6.3-ha5712d3_4
  protobuf           pkgs/main/osx-64::protobuf-3.20.1-py37he9d5cce_0
  pyparsing          pkgs/main/osx-64::pyparsing-3.0.9-py37hecd8cb5_0
  python             pkgs/main/osx-64::python-3.7.7-hc70fcce_0_cpython
  python-dateutil    pkgs/main/noarch::python-dateutil-2.8.2-pyhd3eb1b0_0
  pytz               pkgs/main/osx-64::pytz-2022.1-py37hecd8cb5_0
  pyyaml             pkgs/main/osx-64::pyyaml-6.0-py37hca72f7f_1
  readline           pkgs/main/osx-64::readline-8.1.2-hca72f7f_1
  scikit-learn       pkgs/main/osx-64::scikit-learn-1.0.2-py37hae1ba45_1
  scipy              pkgs/main/osx-64::scipy-1.7.3-py37h214d14d_2
  setuptools         pkgs/main/osx-64::setuptools-63.4.1-py37hecd8cb5_0
  six                pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_1
  sqlite             pkgs/main/osx-64::sqlite-3.39.3-h707629a_0
  tensorboard        pkgs/main/osx-64::tensorboard-1.14.0-py37h80053f4_0
  tensorflow         pkgs/main/osx-64::tensorflow-1.14.0-mkl_py37h085be34_0
  tensorflow-base    pkgs/main/osx-64::tensorflow-base-1.14.0-mkl_py37h5a24fda_0
  tensorflow-estima~ pkgs/main/noarch::tensorflow-estimator-1.14.0-py_0
  termcolor          pkgs/main/osx-64::termcolor-1.1.0-py37hecd8cb5_1
  threadpoolctl      pkgs/main/noarch::threadpoolctl-2.2.0-pyh0d69192_0
  tk                 pkgs/main/osx-64::tk-8.6.12-h5d9f67b_0
  typing_extensions  pkgs/main/osx-64::typing_extensions-4.3.0-py37hecd8cb5_0
  werkzeug           pkgs/main/noarch::werkzeug-2.0.3-pyhd3eb1b0_0
  wheel              pkgs/main/noarch::wheel-0.37.1-pyhd3eb1b0_0
  wrapt              pkgs/main/osx-64::wrapt-1.14.1-py37hca72f7f_0
  xz                 pkgs/main/osx-64::xz-5.2.6-hca72f7f_0
  yaml               pkgs/main/osx-64::yaml-0.2.5-haf1e3a3_0
  zipp               pkgs/main/osx-64::zipp-3.8.0-py37hecd8cb5_0
  zlib               pkgs/main/osx-64::zlib-1.2.12-h4dc903c_3
  zstd               pkgs/main/osx-64::zstd-1.5.2-hcb37349_0

Proceed ([y]/n)? 

Its an enormous data pipeline. Everything is there, thats why it takes so long.

$\endgroup$
7
  • 1
    $\begingroup$ Hi, thanks for your response. I went ahead and created a new conda environment and tried to run the deepbgc install on there with conda instead of pip. The problem now is the install is getting stuck at the "Solving Environment" phase. For whatever reason, It doesn't seem to make it past that point. $\endgroup$
    – Joe_G
    Commented Sep 30, 2022 at 17:27
  • $\begingroup$ Hi @Joe_G I've updated the post, so did it work? $\endgroup$
    – M__
    Commented Oct 1, 2022 at 2:22
  • $\begingroup$ I've found mamba to be a life-saver for getting around conda's slowness with large sets of packages. Its mamba command can act as a drop-in replacement for conda for most purposes and most importantly it solves dependencies much faster. $\endgroup$
    – Jesse
    Commented Oct 1, 2022 at 20:23
  • 1
    $\begingroup$ Unfortunately it never got past the solving environment stage. I was installing it on a remote server and the process took so long that the my user was disconnected from the server before it could finish. I'm going to try again thinking maybe it was an issue with the server. @Jesse I may try Mamba that sounds like it could be helpful. Is that just a package installation? As mentioned before, the warning message wasn't code breaking so I may just be living with it for the time being. I do appreciate the guidance, thanks! $\endgroup$
    – Joe_G
    Commented Oct 3, 2022 at 14:01
  • 1
    $\begingroup$ Will do @M_ Thanks again! $\endgroup$
    – Joe_G
    Commented Oct 3, 2022 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.