【发布时间】:2016-12-05 12:06:49
【问题描述】:
我在 python2.7.9 的“/home/name/pyenv”上获得了一个虚拟环境; 现在我想为它安装'matplotlib'; 然后我激活这个虚拟环境并安装'matplotlib'如下:
- 通过命令“sudo apt-get install python-matplotlib”; (如果删除“sudo”,权限被拒绝),它运行良好,我发现“matplotlib”已完全安装,但它适用于默认 python 而不是虚拟环境(pyenv);
-
通过命令“pip install matplotlib”
我得到如下错误:
* The following required packages can not be built: * freetype
正在清理... 命令 python setup.py egg_info 在 /tmp/pip-build-tYCFkL/matplotlib 中失败,错误代码为 1 异常信息: 回溯(最近一次通话最后): 文件“/home/caofa/odoo-9.0/local/lib/python2.7/site-packages/pip/basecommand.py”,第 122 行,在 main 状态 = self.run(选项,参数) 运行中的文件“/home/caofa/odoo-9.0/local/lib/python2.7/site-packages/pip/commands/install.py”,第 290 行 requirements_set.prepare_files(查找器,force_root_egg_info=self.bundle,bundle=self.bundle) 文件“/home/caofa/odoo-9.0/local/lib/python2.7/site-packages/pip/req.py”,第 1230 行,在 prepare_files req_to_install.run_egg_info() 文件“/home/caofa/odoo-9.0/local/lib/python2.7/site-packages/pip/req.py”,第 326 行,在 run_egg_info command_desc='python setup.py egg_info') 文件“/home/caofa/odoo-9.0/local/lib/python2.7/site-packages/pip/util.py”,第 716 行,在 call_subprocess % (command_desc, proc.returncode, cwd)) 安装错误:命令 python setup.py egg_info 在 /tmp/pip-build-tYCFkL/matplotlib 中失败,错误代码为 1
我想通过方法1安装它,但我不知道如何为虚拟环境安装它。
【问题讨论】:
标签: python matplotlib pip virtualenv