简体   繁体   English

pip-在virtualenv中安装matplotlib

[英]pip - install matplotlib in virtualenv

I want to install matplotlib to virtualenv using pip. 我想使用pip将matplotlib安装到virtualenv。 (pip 7.1.0, python 3.4) (pip 7.1.0,python 3.4)

$ virtualenv venv
$ source venv/bin/activate
$ pip install matplotlib

...
REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.9.2]
                   six: yes [using six version 1.9.0]
              dateutil: yes [using dateutil version 2.4.2]
                  pytz: yes [using pytz version 2015.4]
               tornado: yes [using tornado version 4.2.1]
             pyparsing: yes [using pyparsing version 2.0.3]
                 pycxx: yes [Official versions of PyCXX are not compatible
                        with matplotlib on Python 3.x, since they lack
                        support for the buffer object.  Using local copy]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]

I managed to install most of the dependencies, but pycxx and libaag fails with similar error: 我设法安装了大多数依赖项,但是pycxxlibaag失败并出现类似错误:

Collecting pycxx
  Could not find a version that satisfies the requirement pycxx (from versions: )
No matching distribution found for pycxx

My question is: What did I do wrong? 我的问题是:我做错了什么? Is there some workaround? 有一些解决方法吗?

I could (maybe) install matplotlib using distro package manager and then import it somehow to virtualenv - that's where I would need a help. 我可以(也许)使用发行版软件包管理器安装matplotlib,然后以某种方式将其导入virtualenv-这是我需要帮助的地方。

Have you got numpy and scipy installed already in the venv ? 您已经在venv中安装了numpy和scipy吗? I had some installation issues for numpy, scipy and matplotlib and upgrading pip and setuptools within the enviroment fixed everything: 我遇到了numpy,scipy和matplotlib的安装问题,并且在环境中升级pip和setuptools修复了所有问题:

$ pip install -U pip
$ pip install -U setuptools

If you install matplotlib using a package manageer you can just do the following when setting up your venv: 如果使用软件包管理器安装matplotlib,则可以在设置venv时执行以下操作:

$ virtualenv --system-site-packages myvenv

And that should get matplotlib in to myvenv 那应该让matplotlib进入myvenv

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM