python - ubuntu的virtualenv下安装PIL的依赖包问题
PHPz
PHPz 2017-04-17 17:46:53
0
1
546

在virtualenv下制作验证码时用到PIL,ubuntu的64位原系统下用apt-get install imagemagick就可以了,但在virtualenv下怎么都不行。在安装前阅读readme知道需要的前置依赖包。该装的都装了(无论手动还是apt-get),明确指定位置(图右侧,None为搜索常见位置)。

反复检测,然后始终在这两个地方出错,详情见图片的左侧jpeg,zlib都不ok,然而奇怪的是在原系统下全部都不ok照样顺利使用PIL,virtualenv当然也碰过运气,死活不行。

右侧为搜索常见的文件位置设为None,我在zlib和jpeg把所有whereis,find pkg-configXXXX等方法的位置都填过,换过好几种格式都无果,最后又写回None当然也是不行的。新手自学陷坑,弄了5小时试过把本地环境dist-packages手动迁移什么都试过,建软连接到/usr/lib无果,实在是没办法了。

求破,求解决办法,非常感谢!

PHPz
PHPz

学习是最好的投资!

répondre à tous(1)
左手右手慢动作
  1. 确认(venv)环境下运行的python是venv的python,而不是系统的,可以使用os.path

  2. 确认正确安装了JPEG和ZLIB库
    此外,希望这篇文章能帮到你

https://darrenma.wordpress.com/2012/07/13/installing-pil-into-a-virtualenv-properly-in-ubuntu/

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!