python綠色版的環(huán)境搭建(win)

一、將python目錄環(huán)境添加到path
二、手動安裝pip
下載地址:https://pypi.org/project/pip/

(點擊installation,將get-pip.py另存為)

安裝pip:
python get-pip.py

將python 目錄下的script添加到path
在python根目錄找到python38._pth文件,使用記事本打開,去掉 “import site”前面的 # 號

三、pip換源
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com

上述文本保存到%APPDATA%pip.ini

四、手動安裝pyrsistent(直接裝會報錯)

下載地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyrsistent
安裝pyrsistent:

pip install pyrsistent-0.17.3-cp39-cp39-win_amd64.whl
五、批量安裝包
argon2-cffi==20.1.0
async-generator==1.10
attrs==20.3.0
backcall==0.2.0
bleach==3.2.1
cffi==1.14.4
colorama==0.4.4
decorator==4.4.2
defusedxml==0.6.0
entrypoints==0.3
ipykernel==5.4.2
ipython==7.19.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
jedi==0.18.0
Jinja2==2.11.2
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==6.1.7
jupyter-console==6.2.0
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.5.1
jupyter-core==4.7.0
jupyter-highlight-selected-word==0.2.0
jupyter-latex-envs==1.4.6
jupyter-nbextensions-configurator==0.4.1
jupyterlab-pygments==0.1.2
jupyterlab-widgets==1.0.0
lxml==4.6.2
MarkupSafe==1.1.1
mistune==0.8.4
nbclient==0.5.1
nbconvert==5.6.1
nbformat==5.0.8
nest-asyncio==1.4.3
notebook==6.1.6
packaging==20.8
pandocfilters==1.4.3
parso==0.8.1
pickleshare==0.7.5
prometheus-client==0.9.0
prompt-toolkit==3.0.8
pycparser==2.20
Pygments==2.7.3
pyparsing==2.4.7
python-dateutil==2.8.1
pywin32==300
pywinpty==0.5.7
PyYAML==5.3.1
pyzmq==20.0.0
qtconsole==5.0.1
QtPy==1.9.0
Send2Trash==1.5.0
six==1.15.0
terminado==0.9.1
testpath==0.4.4
tornado==6.1
traitlets==5.0.5
wcwidth==0.2.5
webencodings==0.5.1
widgetsnbextension==3.5.1

以文本方式保存到桌面“1.txt”,下用面的命令批量安裝

pip install -r 1.txt

六、其它配置:

1.生成jupyter配置文件
jupyter notebook  --generate-config
2.修改jupyter默認打開的目錄

打開剛生成的配置文件,找到c.NotebookApp.notebook_dir 取消注釋并改成工作目錄(注意斜線方向!)

c.NotebookApp.notebook_dir = 'D:/workSpace/python'
3.jupyter 自動補全
jupyter contrib nbextension install --user --skip-running-check
4.如果需要在谷歌的colab中打開
c.NotebookApp.allow_origin = 'https://colab.research.google.com'

打開配置文件查找c.NotebookApp.allow_origin,取消注釋并修改

參考:
https://blog.csdn.net/vooandvivi/article/details/108473758
https://blog.csdn.net/outsider2019/article/details/109274996
https://zhuanlan.zhihu.com/p/46975553
https://zhuanlan.zhihu.com/p/54302333
https://www.pythonf.cn/read/132119
http://www.itdecent.cn/p/0ab80f63af8a

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容