更新于2021-11-02
好马配好鞍,Python开发须要IDE,或者说高效的编辑器。Pycharm这种当然是程序员专用的,也是最受欢迎的,但几百兆的安装包也的确臃肿。python 自带的Idle扩展性和实用性不佳。我感觉就目前VS Code风行趋势(跨平台、高效),有一统天下的可能,而且用它Python的数据迷信就会便捷很多。当然大家也可能理解Anaconda,这个数据迷信的全能选手,但他切实太臃肿了,我写这文章就是为了不必他。
1.必要的安装包
- VS Code
- Python 解释器(win7最高反对版本为3.8)
- Git
给Python的pip配置国内镜像
Python之所以弱小,是因为它有很多扩大包。这些包都须要一个叫pip的工具来进行治理和装置。
因为某些家喻户晓的起因,咱们须要将pip的包装置源改为国内镜像,如果不改,装置会十分慢,甚至可能无奈装置。
国内的源有:
阿里云 https://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) https://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 https://pypi.mirrors.ustc.edu.cn/simple/
长期批改:
能够在应用pip的时候在前面加上-i参数,指定pip源。
pip install scrapy -i https://mirrors.aliyun.com/pypi/simple/
永恒批改:
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
应用pip装置几个写代码须要的包
这一步并不是必须的。但倡议装置。flake8和yapf,有助于你代码整洁标准。
装置jupyter lab(举荐)或jupyter notebook
JupyterLab能够被视作一个加强版的资源管理器+交互模式下的python,他能让咱们可视化地进行一些数据操作。是数据迷信必备的工具。pip install jupyterlab
,有的人电脑是pip install jupyter-lab
装置jupyter lab插件
想要高兴的应用jupyter lab,须要装置必要的插件,须要一些筹备。
装置nodejs
https://nodejs.org/zh-cn/down...
win7 最高反对版本为13.6
- 首先装置好nodejs到本地。
- npm设置国内镜像和装置python的nodejs包
npm config set registry https://registry.npm.taobao.orgnpm config get registrypip install nodejs
装置yarn
npm install -g yarn# yarn 设置国内镜像yarn config set registry https://registry.npm.taobao.org/yarn config get registry
装置几个罕用插件
# gitpip install jupyterlab-gitjupyter labextension install @jupyterlab/git# githubjupyter labextension install @jupyterlab/github# tocjupyter labextension install @jupyterlab/toc
jupyter lab 运行R代码
装置IRkernel
#在R装置IRkernelinstall.packages('IRkernel') IRkernel::installspec()jupyter labextension install @techrah/text-shortcuts
留神:如果jupyter lab无奈装置这个插件,或者失败,能够尝试如下2种办法
- 在系统命令行装置
先在R装置IRkernel包
install.packages('devtools')devtools::install_github('IRkernel/IRkernel')
而后切换到R的装置门路运行R,再装置IRkernel::installspec()
- 在windows 找到如下门路,如果没有就新建,而后把IRkernel的文件复制到外面