安装miniconda3
安装pip
在命令行里下载pip:
pip install --upgrade pip --user
在conda prompt里增加镜像路径
pip install pip -U --user
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple --user
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
conda config --set show_channel_urls yes
conda config --show
cmd常用命令
help()
conda list xxx
不要轻易更新conda
# conda update -n base -c defaults conda
爬虫常用宏包
pip install docx
pip install xlrd
pip install xlwt
pip install openpyxl
pip install lxml
pip install jieba
pip install pdfminer3k
pip install pandas
pip install snownlp
pip install sklearn
pip install matplotlib
pip install gensim
安装jupyter
pip install jupyter notebook
配置默认文件路径
jupyter notebook --generate-config
explorer C:\Users\chins\.jupyter
找到 c.NotebookApp.notebook_dir
替换为自己的path E:\\abcdefg\python笔记
jupyter extension
pip install jupyter_contrib_nbextensions
pip install jupyter_nbextensions_configurator
jupyter contrib nbextension install
安装R与Rstudio
conda install R
conda install -c r rstudio
创建一个project文件,然后在工作路径下创建一个bat,用笔记本打开复制如下代码,可以用bat直接打开R的项目文件Rproj。引号内换成自己的项目文件路径。
conda run rstudio "E:/stata_note/R_note/R_note.Rproj"
理论上这个方法可以用rstudio打开任何txt、R、Rproj文件。也可以直接在cmd或者conda prompt里输入这串代码实现。
或者将默认工作路径换成自己的路径,方法如下:
找到文件./Miniconda3/pkgs/r-base-3.5.1-h0c8e037_1007/lib/R/etc/Rprofile.site
,在第一行加入setwd("E:/stata_note/R_note")
网友评论