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

在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

学习是最好的投资!

reply all(1)
左手右手慢动作
  1. Confirm that the python running in the (venv) environment is the python of venv, not the system. You can use os.path

  2. Confirm that the JPEG and ZLIB libraries are installed correctly
    Also, I hope this article can help you

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!