一.使用PyChar m创建项目
- 官网下载PyCharm,使用社区版就够用了(PyCharm Community)
- 安装PyCharm
- 创建新项目
二.PyPI安装包,例如selenium包
- Pypi官网PyPI · The Python Package Index
- 搜索selenium,展示selenium最新包信息
- 若需要下载历史版本,点击selenium最新包,选择历史版本Release History
- 命令行安装:pip install selenium==4.6.0,或下载包自行安装
- pip list查看安装包
- 卸载:pip uninstall selenium
- 若安装慢或超时,需使用镜像地址,命令:pip install -i 镜像地址 --trusted-host 镜像地址host 例如:pip install -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
- 国内镜像地址:
- 豆瓣:http://pypi.douban.com/simple/
- 清华:http://pypi.tuna.tsinghua.edu.cn/simple/
- 阿里云:http://mirrors.aliyun.com/pypi/simple/