我已经在我的虚拟环境中使用pip安装了Matplotlib。一开始安装失败,但是在我执行
以下是我在Git仓库根文件夹下所执行的操作:
似乎Heroku服务器无法正确安装Matplotlib。
当我执行“easy_install -U distribute”时,可能不会被pip记录。
Matplotlib还有几个非Python库依赖项(例如:libjpeg8-dev,libfreetype和libpng6-dev)。 我可以在本地安装这些依赖项(例如:通过apt-get)。 但是,这也没有被pip记录。
所以,我的问题是:如何在Heroku部署服务器上正确安装Matplotlib?
easy_install -U distribute
之后,安装就很顺利了。以下是我在Git仓库根文件夹下所执行的操作:
virtualenv env
source env/bin/activate
pip install gunicorn
pip install numpy
easy_install -U distribute
pip install matplotlib
然后,我使用pip freeze > requirements.txt
来创建一个requirements.txt文件。以下是结果:
argparse==1.2.1
distribute==0.7.3
gunicorn==17.5
matplotlib==1.3.0
nose==1.3.0
numpy==1.7.1
pyparsing==2.0.1
python-dateutil==2.1
six==1.3.0
tornado==3.1
wsgiref==0.1.2
在尝试部署我的应用程序时出现了问题:
(env)gofrendi@kirinThor:~/kokoropy$ git push -u heroku
Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 586 bytes, done.
Total 5 (delta 3), reused 0 (delta 0)
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.4.
-----> Using Python runtime (python-2.7.4)
-----> Installing dependencies using Pip (1.3.1)
Downloading/unpacking distribute==0.7.3 (from -r requirements.txt (line 2))
Running setup.py egg_info for package distribute
Downloading/unpacking matplotlib==1.3.0 (from -r requirements.txt (line 4))
Running setup.py egg_info for package matplotlib
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.24 (/app/.heroku/python/lib/python2.7/site-packages))
Complete output from command python setup.py egg_info:
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.24 (/app/.heroku/python/lib/python2.7/site-packages))
----------------------------------------
Command python setup.py egg_info failed with error code 2 in /tmp/pip-build-u55833/matplotlib
Storing complete log in /app/.pip/pip.log
! Push rejected, failed to compile Python app
To git@heroku.com:kokoropy.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:kokoropy.git'
(env)gofrendi@kirinThor:~/kokoropy$
似乎Heroku服务器无法正确安装Matplotlib。
当我执行“easy_install -U distribute”时,可能不会被pip记录。
Matplotlib还有几个非Python库依赖项(例如:libjpeg8-dev,libfreetype和libpng6-dev)。 我可以在本地安装这些依赖项(例如:通过apt-get)。 但是,这也没有被pip记录。
所以,我的问题是:如何在Heroku部署服务器上正确安装Matplotlib?