之前一直想装DCA,出现各种问题,主要是tensorflow版本和keras版本不对应的问题,成功安装的步骤记录如下:
首先创建DCA环境
conda create -n DCA python==3.6.10
安装DCA
conda install -c bioconda dca
另外可以测试是否导入出现问题,使用下面代码
from dca.api import dca
这时会发现提示错误,没有安装tensorflow, 这里就涉及到一个tensorflow的版本问题,我尝试过tf=2.2.0和tf=2.6.2都会发生错误,最终的tensorflow版本和keras版本是
pip install tensorflow==2.4.0 pip install keras==2.4.3
这个是没有问题的,但是我当时好像调整过numpy的版本
pip install numpy==1.18 pip install scipy==1.1.0
然后需要安装一些额外的包
pip install rpy2==3.4.2
然后创建kernel即可
conda activate DCA pip install ipykernel python -m ipykernel install --name dca --user
另外我的环境如下
pip list
absl-py (0.15.0) anndata (0.6.22.post1) annoy (1.17.0) appnope (0.1.3) astor (0.8.1) astunparse (1.6.3) backcall (0.2.0) backports.zoneinfo (0.2.1) cached-property (1.5.2) cachetools (4.2.4) certifi (2021.10.8) cffi (1.15.0) charset-normalizer (2.0.12) clang (5.0) cloudpickle (0.4.0) cycler (0.10.0) dataclasses (0.8) DCA (0.3.4) decorator (4.1.2) entrypoints (0.4) flatbuffers (1.12) future (0.16.0) gast (0.3.3) google-auth (1.35.0) google-auth-oauthlib (0.4.6) google-pasta (0.2.0) grpcio (1.32.0) h5py (2.10.0) hyperopt (0.2.2) idna (3.3) importlib-metadata (4.8.3) importlib-resources (5.4.0) ipykernel (5.5.6) ipython (7.16.3) ipython-genutils (0.2.0) jedi (0.17.2) Jinja2 (3.0.3) jupyter-client (7.1.2) jupyter-core (4.9.2) Keras (2.4.3) Keras-Applications (1.0.8) Keras-Preprocessing (1.1.2) kiwisolver (1.3.1) kopt (0.1.0) llvmlite (0.20.0) louvain (0.7.0) Markdown (3.3.6) MarkupSafe (2.0.1) matplotlib (3.1.0) natsort (5.1.0) nest-asyncio (1.5.5) networkx (1.11) numba (0.35.0) numexpr (2.6.2) numpy (1.19.5) oauthlib (3.2.0) opt-einsum (3.3.0) pandas (0.24.2) parso (0.7.1) patsy (0.4.1) pexpect (4.8.0) pickleshare (0.7.5) pip (9.0.1) prompt-toolkit (3.0.29) protobuf (3.19.4) ptyprocess (0.7.0) pyasn1 (0.4.8) pyasn1-modules (0.2.8) pycparser (2.21) Pygments (2.12.0) pymongo (3.4.0) pyparsing (2.2.0) python-dateutil (2.6.1) python-igraph (0.7.1.post6) pytz (2017.2) pytz-deprecation-shim (0.1.0.post0) PyYAML (3.12) pyzmq (22.3.0) requests (2.27.1) requests-oauthlib (1.3.1) rpy2 (3.4.2) rsa (4.8) scanorama (1.7.1) scanpy (1.4.2) scikit-learn (0.19.0) scipy (1.1.0) seaborn (0.8) setuptools (59.6.0) six (1.15.0) statsmodels (0.8.0) tables (3.4.2) tensorboard (2.6.0) tensorboard-data-server (0.6.1) tensorboard-plugin-wit (1.8.1) tensorflow (2.4.0) tensorflow-estimator (2.4.0) termcolor (1.1.0) tornado (4.5.2) tqdm (4.7.2) traitlets (4.3.3) typing-extensions (3.7.4.3) tzdata (2022.1) tzlocal (4.2) urllib3 (1.26.9) wcwidth (0.2.5) Werkzeug (2.0.3) wheel (0.37.1) wrapt (1.12.1) zipp (3.6.0)
conda list
# packages in environment at /Users/xiaokangyu/opt/anaconda3/envs/DCA: # # Name Version Build Channel absl-py 0.15.0 pypi_0 pypi anndata 0.6.22.post1 py_0 bioconda appnope 0.1.3 pypi_0 pypi astor 0.8.1 pypi_0 pypi astunparse 1.6.3 pypi_0 pypi backcall 0.2.0 pypi_0 pypi backports-zoneinfo 0.2.1 pypi_0 pypi blas 1.0 mkl https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free ca-certificates 2021.10.8 h033912b_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge cached-property 1.5.2 pypi_0 pypi cachetools 4.2.4 pypi_0 pypi certifi 2016.2.28 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free cffi 1.15.0 pypi_0 pypi clang 5.0 pypi_0 pypi cloudpickle 0.4.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free cycler 0.10.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free dataclasses 0.8 pypi_0 pypi dca 0.3.4 pyhdfd78af_0 bioconda decorator 4.1.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free entrypoints 0.4 pypi_0 pypi flatbuffers 1.12 pypi_0 pypi freetype 2.10.4 h4cff582_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge future 0.16.0 py36_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free gast 0.3.3 pypi_0 pypi google-auth 1.35.0 pypi_0 pypi google-auth-oauthlib 0.4.6 pypi_0 pypi google-pasta 0.2.0 pypi_0 pypi grpcio 1.32.0 pypi_0 pypi h5py 2.10.0 pypi_0 pypi hdf5 1.8.17 2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free hyperopt 0.2.2 py_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge importlib-metadata 4.8.3 pypi_0 pypi importlib-resources 5.4.0 pypi_0 pypi ipykernel 5.5.6 pypi_0 pypi ipython 7.16.3 pypi_0 pypi ipython-genutils 0.2.0 pypi_0 pypi jedi 0.17.2 pypi_0 pypi jinja2 3.0.3 pypi_0 pypi jupyter-client 7.1.2 pypi_0 pypi jupyter-core 4.9.2 pypi_0 pypi keras 2.4.3 pypi_0 pypi keras-applications 1.0.8 pypi_0 pypi keras-preprocessing 1.1.2 pypi_0 pypi kiwisolver 1.3.1 py36hc61eee1_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge kopt 0.1.0 pyh145b6a8_2 bioconda libcxx 13.0.1 hc203e6f_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge libffi 3.2.1 1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free libpng 1.6.37 h7cec526_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge llvmlite 0.20.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free louvain 0.7.0 py36h22858aa_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge markdown 3.3.6 pypi_0 pypi markupsafe 2.0.1 pypi_0 pypi matplotlib 3.1.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge matplotlib-base 3.1.0 py36habd5b94_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge mkl 2017.0.3 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free natsort 5.1.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free ncurses 6.3 h96cf925_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge nest-asyncio 1.5.5 pypi_0 pypi networkx 1.11 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free numba 0.35.0 np113py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free numexpr 2.6.2 np113py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free numpy 1.19.5 pypi_0 pypi oauthlib 3.2.0 pypi_0 pypi openssl 1.1.1n h6c3fc93_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge opt-einsum 3.3.0 pypi_0 pypi pandas 0.24.2 py36h0a44026_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge parso 0.7.1 pypi_0 pypi patsy 0.4.1 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free pexpect 4.8.0 pypi_0 pypi pickleshare 0.7.5 pypi_0 pypi pip 9.0.1 py36_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free prompt-toolkit 3.0.29 pypi_0 pypi protobuf 3.19.4 pypi_0 pypi ptyprocess 0.7.0 pypi_0 pypi pyasn1 0.4.8 pypi_0 pypi pyasn1-modules 0.2.8 pypi_0 pypi pycparser 2.21 pypi_0 pypi pygments 2.12.0 pypi_0 pypi pymongo 3.4.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free pyparsing 2.2.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free pytables 3.4.2 np113py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free python 3.6.10 h4334963_1011_cpython https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge python-dateutil 2.6.1 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free python-igraph 0.7.1.post6 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge python_abi 3.6 2_cp36m https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge pytz 2017.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free pytz-deprecation-shim 0.1.0.post0 pypi_0 pypi pyyaml 3.12 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free pyzmq 22.3.0 pypi_0 pypi readline 8.1 h05e3726_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge requests-oauthlib 1.3.1 pypi_0 pypi rpy2 3.4.2 pypi_0 pypi rsa 4.8 pypi_0 pypi scanpy 1.4.2 py_0 bioconda scikit-learn 0.19.0 np113py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free scipy 1.1.0 pypi_0 pypi seaborn 0.8 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free setuptools 59.6.0 pypi_0 pypi six 1.15.0 pypi_0 pypi sqlite 3.36.0 h23a322b_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge statsmodels 0.8.0 np113py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free tensorboard 2.6.0 pypi_0 pypi tensorboard-data-server 0.6.1 pypi_0 pypi tensorboard-plugin-wit 1.8.1 pypi_0 pypi tensorflow 2.4.0 pypi_0 pypi tensorflow-estimator 2.4.0 pypi_0 pypi termcolor 1.1.0 pypi_0 pypi tk 8.6.11 h5dbffcc_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge tornado 4.5.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free tqdm 4.7.2 py36_0 bioconda traitlets 4.3.3 pypi_0 pypi typing-extensions 3.7.4.3 pypi_0 pypi tzdata 2022.1 pypi_0 pypi tzlocal 4.2 pypi_0 pypi wcwidth 0.2.5 pypi_0 pypi werkzeug 2.0.3 pypi_0 pypi wheel 0.37.1 pypi_0 pypi wrapt 1.12.1 pypi_0 pypi xz 5.2.5 haf1e3a3_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge yaml 0.1.6 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free zipp 3.6.0 pypi_0 pypi zlib 1.2.11 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free



