Pycharm安装包numpy和matplotlib安装

环境

python 3.12

Pycharm 2023.1

安装包

创建图表的 numpy 库和 matplotlib

安装过程出现的问题

  1. setuptools工具包没有安装
powershell 复制代码
Python packaging tool 'setuptools' not found

文件 -> 设置 -> 项目:xxx -> python解释器界面显示不出已安装的软件包,系统提示需要安装工具包

  1. 直接点击系统提示的安装工具包,安装失败
powershell 复制代码
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
  1. 利用本地终端,输入命令行pip install setuptools,显示pip没有安装
powershell 复制代码
无法将"pip"项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:1 字符: 1

解决办法

  1. 环境变量设置
    找到python安装路径下的Scripts下的pip.exe

    复制路径

    找到文件 -> 设置 -> 工具 -> 终端界面的环境变量,添加环境变量path,值为
powershell 复制代码
pip.exe路径;Scripts文件夹路径

例如

powershell 复制代码
D:\Program Files\python3.12.3\Scripts\pip.exe;D:\Program Files\python3.12.3\Scripts\
  1. 升级pip解决安装出现的问题2

本地终端输入

powershell 复制代码
py -m ensurepip --upgrade
powershell 复制代码
py -m pip install --upgrade pip
powershell 复制代码
pip install setuptools
powershell 复制代码
python3.12 -m pip install --upgrade setuptools

再次打开文件 -> 设置 -> 项目:xxx -> python解释器界面,已安装软件包能正常显示,表示setuptools安装成功

  1. 安装numpy和matplotlib库

安装完成后python解释器的软件安装包界面显示numpy和matplotlib安装包,表示安装成功

相关推荐
chusheng184020 分钟前
Python 如何使用 multiprocessing 模块创建进程池
python·信息可视化·matplotlib
白拾4 小时前
使用NumPy进行线性代数的快速指南
线性代数·numpy
莫负初6 小时前
Pytest 使用Pycharm右键直接运行测试脚本正常,控制台命令pytest运行收集不到用例无法正常测试 no tests ran in 0.01s
ide·pycharm·pytest
一个闪现必杀技16 小时前
Python入门--函数
开发语言·python·青少年编程·pycharm
陈苏同学17 小时前
4. 将pycharm本地项目同步到(Linux)服务器上——深度学习·科研实践·从0到1
linux·服务器·ide·人工智能·python·深度学习·pycharm
Ambition_LAO17 小时前
解决:进入 WSL(Windows Subsystem for Linux)以及将 PyCharm 2024 连接到 WSL
linux·pycharm
ZPC82101 天前
Python使用matplotlib绘制图形大全(曲线图、条形图、饼图等)
开发语言·python·matplotlib
弱冠少年1 天前
websockets库使用(基于Python)
开发语言·python·numpy
没有余地 EliasJie1 天前
Windows Ubuntu下搭建深度学习Pytorch训练框架与转换环境TensorRT
pytorch·windows·深度学习·ubuntu·pycharm·conda·tensorflow
A_lvvx2 天前
07_矩形圆形绘制
开发语言·python·numpy