我用的python 编译工具为 vscode,不会用留言,教大家用,哈哈
学习Scanpy , 先给它配个虚拟环境吧
vitrualenv sc_learnp


在虚拟环境下安装所需要的python 包
直接
pip install pandas
pip install sc
pip install scanpy
pandas 的依赖包 Numpy 装 1.19.3, 要不然报错 ,安装pandas 时自动安装最新,运行报错的话需要卸掉 再重装
pip uninstall numpy
pip install numpy==1.19.3

创建学习目录和下载学习数据吧,参考 官网
https://scanpy-tutorials.readthedocs.io/en/latest/pbmc3k.html
学习需要看图,在vscode 上用 Jupyter 哦,方便交互看图学习
按 ctrl+ shif + p ,选择create New Blank Jupyter Notebook

新建的jupyter 一定要切换成虚拟环境下的 python哦

选择刚才我们新建的虚拟环境

如果没有发现我们刚才新建的虚拟环境,不要慌,我们可以设置哈
到vs code 中选择setting,

输入 json

点击 settings.json

把画框的红色路径修改为刚才新建的虚拟路径保存重启后,新建jupyter ,再点击Jupyter的python切换,就可以看到我们新建的虚拟环境的python 路径了,选择它哦,vscode会提示还需要装 ipykernel ,
pip install ipykernel
就行

然后测试环境是否成功,运行成功,学习环境就准备好了哈

开始学习的学习环境文件要准备好

网友评论