====== 2.基础安装 ====== 学习资源: [[https://docs.python.org/zh-cn/3/|Python 官方文档]] [[https://docs.pythontab.com/|Python 在线手册]] pip install 库名 -i 换源地址 例如:pip install SomePackage -i https://pypi.douban.com/simple 常用换源安装地址: 豆瓣(douban):http://pypi.douban.com/simple/ 阿里:http://mirrors.aliyun.com/pypi/simple/ 中国科学技术大学:http://pypi.mirrors.ustc.edu.cn/simple 中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/ 清华大学:https://pypi.tuna.tsinghua.edu.cn/simple ===== -# PC配置环境变量 ===== 安装时选择添加环境变量,免得手动添加。[[https://blog.csdn.net/qq_40891747/article/details/121199817|安装python3(包括更改安装路径、添加环境路径)]] ==== - 查看安裝路径 ==== {{ :python:安装路径.png?400 |}} ==== - site-packages库问题 ==== {{ :python:module:重复安装myqr.png?400 |}} [[https://blog.csdn.net/lyx4949/article/details/126988235|解决多个python版本安装第三方库出现“...is not a supported wheel on this platform”]] ===== -# Python 虚拟环境管理工具 ===== ==== - virtualenv ==== ==== - virtualenvwrapper ==== ==== - pipenv ==== ==== - conda ==== === 报错 === CondaError: Run 'conda init' before 'conda activate' Anaconda Prompt工具可以直接打开默认base环境,1.deactivate 2.切换盘符 不要使用cd命令 切换盘符 3.使用cd 绝对路径进入项目文件 ===== -# 安装 PhatomJS ===== Selenium 不再支持 PhantomJS 的解决办法 ==== -# 占位符 ==== === - 占位符 === ===== -# vscode 相关配置 ===== 安装VSCode的Python插件 选择python解释器 ctrl+shift+P打开VSCode的命令行,输入python: select Interpreter选择合适的python版本。 ==== - 停止维护 ==== Python for VSCode 此扩展已弃用,因为已不再对其进行维护。 ==== - python虚拟环境 ==== {{:python:没有为python解释器选择虚拟环境.jpg?600|}} 当前没有为python解释器选择虚拟环境。是否要创建虚拟环境? [[https://blog.csdn.net/qq_45261963/article/details/121493697|解决问题:VScode使用python虚拟环境(图文并茂版)]] ==== - intelliCode 报错 ==== {{:python:inellicaode报错_20240419160843.jpg?600|}} Sorry, something went wrong activating IntelliCode support for Python. Please check the "Python" and "VS IntelliCode" output windows for details. ===== -# 宝塔 ===== ==== - 切换python版本 ==== [[https://blog.csdn.net/qq_27295403/article/details/121475229|如何在宝塔面板设置python指定版本为默认的python环境]] {{ :python:module:宝塔切换版本.png?400 |}}