PIP/easy_install PIL in Virtualenv vcvarsall。蝙蝠错误Windows 7

时间:2023-01-04 00:25:10

So I know there's a fair amount of documentation on this already, but I just can't seem to get it to work. I'm deploying a Django app to Heroku, and am trying to install PIL into my virtualenv (a main part of the app requires user uploaded images).

我知道已经有大量的文档了,但是我似乎无法让它发挥作用。我正在将Django应用程序部署到Heroku,并试图将PIL安装到我的virtualenv(应用程序的主要部分需要用户上传图像)。

I've tried both

我试过两

easy_install PIL

and

pip install PIL

pip安装公益诉讼

and everyone the installation ends in

每个人的安装都结束了

error: Unable to find vcvarsall.bat.

How can I get PIL into my virtualenv? Can anyone walk me through it?

我怎样才能把PIL放进我的virtualenv?谁能陪我走过去吗?

Thanks!

谢谢!

4 个解决方案

#1


2  

I don't know about Windows, but easy_install PIL does not work well. easy_install pillow (compatible with setuptools) does the trick. It will still need compilation if I remember correctly, and then you could have a look there : Unable to find vcvarsall.bat

我不知道Windows,但是easy_install PIL不太好用。easy_install pillow(兼容setuptools)解决了这个问题。如果我没记错的话,它仍然需要编译,然后您可以在那里看到:无法找到vcvarsall.bat

#2


1  

PIL required make.exe or nmake.exe, you may need to install visual studio. vcvarsall.bat is part of visual c++. Please install binary package from http://www.lfd.uci.edu/~gohlke/pythonlibs/

公益诉讼要求。exe或nmake。exe,您可能需要安装visual studio。vcvarsall。bat是visual c++的一部分。请从http://www.lfd.uci.edu/~gohlke/pythonlibs/安装二进制包

#3


1  

As stated in other answers Pillow is the way to go since PIP is not compatible with setuptools.

如其他答案中所述,Pillow是解决办法,因为PIP与setuptools不兼容。

So you may just do:

你可以这样做:

pip install pillow

Now, since you are working on windows you may run into compilation issues. You will need to install a gcc compiler in order for this to work. I just ran into this issue and blogged about this here.

现在,由于您正在处理windows,您可能会遇到编译问题。您将需要安装一个gcc编译器以使其工作。我刚刚遇到了这个问题,并在这里写了博客。

#4


1  

To install Pillow For this you need a compiler installed on computer, using Microsoft Visual Studio 9.0 (2008) Express Edition (Free). You need this c++ compiler for pillow to install. Install from here

要安装枕头,你需要在电脑上安装一个编译器,使用Microsoft Visual Studio 9.0 (2008) Express Edition(免费)。你需要这个c++编译器来安装枕头。安装在这里

http://download.microsoft.com/download/A/5/4/A54BADB6-9C3F-478D-8657-93B3FC9FE62D/vcsetup.exe

open cmd prompt and enter the following

打开cmd提示符并输入以下内容

"C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat" 

this updates the PATH variable (no need for registry hacks, even in a virtualenv).

这将更新路径变量(即使在virtualenv中,也不需要对注册表进行修改)。

Because of firewall difficulties I usually pip install from a local directory

由于防火墙的困难,我通常从本地目录安装pip

pip install -e c:\django\test_virtualenv\Pillow

Pillow must be the correction version for your O/S and computer architecture.

枕头必须是你的O/S和计算机架构的修正版本。

#1


2  

I don't know about Windows, but easy_install PIL does not work well. easy_install pillow (compatible with setuptools) does the trick. It will still need compilation if I remember correctly, and then you could have a look there : Unable to find vcvarsall.bat

我不知道Windows,但是easy_install PIL不太好用。easy_install pillow(兼容setuptools)解决了这个问题。如果我没记错的话,它仍然需要编译,然后您可以在那里看到:无法找到vcvarsall.bat

#2


1  

PIL required make.exe or nmake.exe, you may need to install visual studio. vcvarsall.bat is part of visual c++. Please install binary package from http://www.lfd.uci.edu/~gohlke/pythonlibs/

公益诉讼要求。exe或nmake。exe,您可能需要安装visual studio。vcvarsall。bat是visual c++的一部分。请从http://www.lfd.uci.edu/~gohlke/pythonlibs/安装二进制包

#3


1  

As stated in other answers Pillow is the way to go since PIP is not compatible with setuptools.

如其他答案中所述,Pillow是解决办法,因为PIP与setuptools不兼容。

So you may just do:

你可以这样做:

pip install pillow

Now, since you are working on windows you may run into compilation issues. You will need to install a gcc compiler in order for this to work. I just ran into this issue and blogged about this here.

现在,由于您正在处理windows,您可能会遇到编译问题。您将需要安装一个gcc编译器以使其工作。我刚刚遇到了这个问题,并在这里写了博客。

#4


1  

To install Pillow For this you need a compiler installed on computer, using Microsoft Visual Studio 9.0 (2008) Express Edition (Free). You need this c++ compiler for pillow to install. Install from here

要安装枕头,你需要在电脑上安装一个编译器,使用Microsoft Visual Studio 9.0 (2008) Express Edition(免费)。你需要这个c++编译器来安装枕头。安装在这里

http://download.microsoft.com/download/A/5/4/A54BADB6-9C3F-478D-8657-93B3FC9FE62D/vcsetup.exe

open cmd prompt and enter the following

打开cmd提示符并输入以下内容

"C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat" 

this updates the PATH variable (no need for registry hacks, even in a virtualenv).

这将更新路径变量(即使在virtualenv中,也不需要对注册表进行修改)。

Because of firewall difficulties I usually pip install from a local directory

由于防火墙的困难,我通常从本地目录安装pip

pip install -e c:\django\test_virtualenv\Pillow

Pillow must be the correction version for your O/S and computer architecture.

枕头必须是你的O/S和计算机架构的修正版本。