Python 在虚拟环境中安装matplotlib时出错

Python 在虚拟环境中安装matplotlib时出错,python,matplotlib,virtualenv,zsh,Python,Matplotlib,Virtualenv,Zsh,正在尝试在虚拟环境中安装matplotlib。运行pip install matplotlib时,出现以下错误: zsh: /Users/username/Desktop/tensorflow_tutorials/.venv/bin/pip: bad interpreter: /Users/username/Desktop/tensorflow/.venv/bin/python3: no such file or directory tensorflow\u教程是我在其中创建虚拟环境的目录 我

正在尝试在虚拟环境中安装
matplotlib
。运行
pip install matplotlib
时,出现以下错误:

zsh: /Users/username/Desktop/tensorflow_tutorials/.venv/bin/pip: bad interpreter:
/Users/username/Desktop/tensorflow/.venv/bin/python3: no such file or directory
tensorflow\u教程
是我在其中创建虚拟环境的目录

我已尝试
pip3安装matplotlib
,并收到以下消息:

zsh: /Users/username/Desktop/tensorflow_tutorials/.venv/bin/pip3: bad interpreter: /Users/username/Desktop/tensorflow/.venv/bin/python3: no such file or directory
Requirement already satisfied: matplotlib in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (3.1.1)
Requirement already satisfied: numpy>=1.11 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib) (1.17.3)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib) (2.4.2)
Requirement already satisfied: kiwisolver>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib) (1.1.0)
Requirement already satisfied: python-dateutil>=2.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib) (2.8.0)
Requirement already satisfied: cycler>=0.10 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib) (40.8.0)
Requirement already satisfied: six>=1.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from python-dateutil>=2.1->matplotlib) (1.12.0)
pip安装之前,我已尝试运行
source./.venv/bin/activate
,但也不起作用