安装模块

PS D:\pythonprojects\p1\venv\Scripts> .\pip3.10.exe install openpyxl

如果报 TypeError: ‘type‘ object is not subscriptable 的错误 是因为解释器和pip版本不一致导致的。 可以通过将pip文件都删掉,重新安装pip

python -m ensurepip --default-pip

安装了适用当前解释器的pip pip install xxx安装库 如果出现 Requirement already satisfied 的错误 可以通过制定安装路径的方式安装到工程下

pip install --target=D:\pythonprojects\untitled1\venv\Scripts Pandas

创建pycharm虚拟环境的时候断网,也能阻止pip更新到最新

Table of Contents