由于警告和 ValueError,无法在 Windows 的 virtualenv 中 pip 安装 PIL

2023-12-04

我正在尝试安装PIL在 virtualenv 中但失败了。我创建了一个全新的 virtualenv 并做了pip install PIL并得到以下结果

C:\Users\s3z\Desktop\My Dropbox\pythons\ham>Scripts\activate
(ham) C:\Users\s3z\Desktop\My Dropbox\pythons\ham>pip install PIL
Downloading/unpacking PIL
  Downloading PIL-1.1.7.tar.gz (506Kb): 506Kb downloaded
  Running setup.py egg_info for package PIL
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py

Installing collected packages: PIL
  Running setup.py install for PIL
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py
    building '_imaging' extension
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\s3z\Desktop\My Dropbox\pythons\ham\build\PIL\setup.py", line 486, in <module>
        version=VERSION,
      File "C:\Python27\Lib\distutils\core.py", line 152, in setup
        dist.run_commands()
      File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "C:\Users\s3z\Desktop\My Dropbox\pythons\ham\lib\site-packages\distribute-0.6.24-py2.7.egg\setuptools\command\install.py", line 53, in
run
        return _install.run(self)
      File "C:\Python27\Lib\distutils\command\install.py", line 563, in run
        self.run_command('build')
      File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "C:\Python27\Lib\distutils\command\build.py", line 127, in run
        self.run_command(cmd_name)
      File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "C:\Python27\Lib\distutils\command\build_ext.py", line 340, in run
        self.build_extensions()
      File "C:\Users\s3z\Desktop\My Dropbox\pythons\ham\build\PIL\setup.py", line 368, in build_extensions
        build_ext.build_extensions(self)
      File "C:\Python27\Lib\distutils\command\build_ext.py", line 449, in build_extensions
        self.build_extension(ext)
      File "C:\Python27\Lib\distutils\command\build_ext.py", line 499, in build_extension
        depends=ext.depends)
      File "C:\Python27\Lib\distutils\msvc9compiler.py", line 469, in compile
        self.initialize()
      File "C:\Python27\Lib\distutils\msvc9compiler.py", line 379, in initialize
        vc_env = query_vcvarsall(VERSION, plat_spec)
      File "C:\Python27\Lib\distutils\msvc9compiler.py", line 295, in query_vcvarsall
        raise ValueError(str(list(result.keys())))
    ValueError: [u'path']
    Complete output from command "C:\Users\s3z\Desktop\My Dropbox\pythons\ham\Scripts\python.exe" -c "import setuptools;__file__='C:\\Users\\s3z
\\Desktop\\My Dropbox\\pythons\\ham\\build\\PIL\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --s
ingle-version-externally-managed --record c:\users\s3z\appdata\local\temp\pip-f7ttlx-record\install-record.txt --install-headers "C:\Users\s3z
\Desktop\My Dropbox\pythons\ham\include\site\python2.7":
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py

running install

running build

running build_py

creating build

creating build\lib.win-amd64-2.7

copying PIL\ArgImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\BdfFontFile.py -> build\lib.win-amd64-2.7

copying PIL\BmpImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\ContainerIO.py -> build\lib.win-amd64-2.7

copying PIL\CurImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\DcxImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\EpsImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\ExifTags.py -> build\lib.win-amd64-2.7

copying PIL\FitsStubImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\FliImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\FontFile.py -> build\lib.win-amd64-2.7

copying PIL\FpxImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\GbrImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\GdImageFile.py -> build\lib.win-amd64-2.7

copying PIL\GifImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\GimpGradientFile.py -> build\lib.win-amd64-2.7

copying PIL\GimpPaletteFile.py -> build\lib.win-amd64-2.7

copying PIL\GribStubImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\IcnsImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\IcoImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\Image.py -> build\lib.win-amd64-2.7

copying PIL\ImageChops.py -> build\lib.win-amd64-2.7

copying PIL\ImageCms.py -> build\lib.win-amd64-2.7

copying PIL\ImageColor.py -> build\lib.win-amd64-2.7

copying PIL\ImageDraw.py -> build\lib.win-amd64-2.7

copying PIL\ImageDraw2.py -> build\lib.win-amd64-2.7

copying PIL\ImageEnhance.py -> build\lib.win-amd64-2.7

copying PIL\ImageFile.py -> build\lib.win-amd64-2.7

copying PIL\ImageFileIO.py -> build\lib.win-amd64-2.7

copying PIL\ImageFilter.py -> build\lib.win-amd64-2.7

copying PIL\ImageFont.py -> build\lib.win-amd64-2.7

copying PIL\ImageGL.py -> build\lib.win-amd64-2.7

copying PIL\ImageGrab.py -> build\lib.win-amd64-2.7

copying PIL\ImageMath.py -> build\lib.win-amd64-2.7

copying PIL\ImageMode.py -> build\lib.win-amd64-2.7

copying PIL\ImageOps.py -> build\lib.win-amd64-2.7

copying PIL\ImagePalette.py -> build\lib.win-amd64-2.7

copying PIL\ImagePath.py -> build\lib.win-amd64-2.7

copying PIL\ImageQt.py -> build\lib.win-amd64-2.7

copying PIL\ImageSequence.py -> build\lib.win-amd64-2.7

copying PIL\ImageShow.py -> build\lib.win-amd64-2.7

copying PIL\ImageStat.py -> build\lib.win-amd64-2.7

copying PIL\ImageTk.py -> build\lib.win-amd64-2.7

copying PIL\ImageTransform.py -> build\lib.win-amd64-2.7

copying PIL\ImageWin.py -> build\lib.win-amd64-2.7

copying PIL\ImImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\ImtImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\IptcImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\JpegImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\McIdasImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\MicImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\MpegImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\MspImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\OleFileIO.py -> build\lib.win-amd64-2.7

copying PIL\PaletteFile.py -> build\lib.win-amd64-2.7

copying PIL\PalmImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\PcdImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\PcfFontFile.py -> build\lib.win-amd64-2.7

copying PIL\PcxImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\PdfImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\PixarImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\PngImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\PpmImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\PsdImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\PSDraw.py -> build\lib.win-amd64-2.7

copying PIL\SgiImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\SpiderImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\SunImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\TarIO.py -> build\lib.win-amd64-2.7

copying PIL\TgaImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\TiffImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\TiffTags.py -> build\lib.win-amd64-2.7

copying PIL\WalImageFile.py -> build\lib.win-amd64-2.7

copying PIL\WmfImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\XbmImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\XpmImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-2.7

copying PIL\__init__.py -> build\lib.win-amd64-2.7

running build_ext

building '_imaging' extension

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "C:\Users\s3z\Desktop\My Dropbox\pythons\ham\build\PIL\setup.py", line 486, in <module>

    version=VERSION,

  File "C:\Python27\Lib\distutils\core.py", line 152, in setup

    dist.run_commands()

  File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands

    self.run_command(cmd)

  File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "C:\Users\s3z\Desktop\My Dropbox\pythons\ham\lib\site-packages\distribute-0.6.24-py2.7.egg\setuptools\command\install.py", line 53, in run

    return _install.run(self)

  File "C:\Python27\Lib\distutils\command\install.py", line 563, in run

    self.run_command('build')

  File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "C:\Python27\Lib\distutils\command\build.py", line 127, in run

    self.run_command(cmd_name)

  File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "C:\Python27\Lib\distutils\command\build_ext.py", line 340, in run

    self.build_extensions()

  File "C:\Users\s3z\Desktop\My Dropbox\pythons\ham\build\PIL\setup.py", line 368, in build_extensions

    build_ext.build_extensions(self)

  File "C:\Python27\Lib\distutils\command\build_ext.py", line 449, in build_extensions

    self.build_extension(ext)

  File "C:\Python27\Lib\distutils\command\build_ext.py", line 499, in build_extension

    depends=ext.depends)

  File "C:\Python27\Lib\distutils\msvc9compiler.py", line 469, in compile

    self.initialize()

  File "C:\Python27\Lib\distutils\msvc9compiler.py", line 379, in initialize

    vc_env = query_vcvarsall(VERSION, plat_spec)

  File "C:\Python27\Lib\distutils\msvc9compiler.py", line 295, in query_vcvarsall

    raise ValueError(str(list(result.keys())))

ValueError: [u'path']

----------------------------------------
Command "C:\Users\s3z\Desktop\My Dropbox\pythons\ham\Scripts\python.exe" -c "import setuptools;__file__='C:\\Users\\s3z\\Desktop\\My Dropbox\\
pythons\\ham\\build\\PIL\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-
managed --record c:\users\s3z\appdata\local\temp\pip-f7ttlx-record\install-record.txt --install-headers "C:\Users\s3z\Desktop\My Dropbox\pytho
ns\ham\include\site\python2.7" failed with error code 1 in C:\Users\s3z\Desktop\My Dropbox\pythons\ham\build\PIL
Storing complete log in C:\Users\s3z\AppData\Roaming\pip\pip.log

这里出了什么问题?如何在virtualenv中成功安装PIL?


使用 PIP 在 Windows 上安装 PIL 给我带来了问题,但使用 easy_install 效果很好。

“c:\VirtualENV \ easy_install PIL”

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

由于警告和 ValueError,无法在 Windows 的 virtualenv 中 pip 安装 PIL 的相关文章

  • 如何修复 Apache mod_wsgi 的 Python 版本不匹配问题?

    我收到此错误 Thu Jul 12 14 31 36 2012 error python init Python version mismatch expected 2 6 7 found 2 6 8 当尝试启动 Apache 服务器时 在
  • 如何忽略传递给函数的意外关键字参数?

    假设我有一些功能 f def f a None print a 现在 如果我有一本字典 比如dct a Foo 我可以打电话f dct 并得到结果Foo打印 但是 假设我有一本字典dct2 a Foo b Bar 如果我打电话f dct2
  • 重新索引错误没有意义

    I have DataFrames大小在 100k 到 2m 之间 我正在处理这个问题的框架是如此之大 但请注意 我必须对其他框架执行相同的操作 gt gt gt len data 357451 现在这个文件是通过编译许多文件创建的 所以它
  • Python sqlite3参数化删除表

    我在 python 中删除 sqlite3 表时遇到问题 我正在使用标准sqlite3模块 self conn sqlite3 connect sql drop table self conn execute sql u table nam
  • 在 Python 中绘制分类数据的三个维度

    我的数据包含三个我试图可视化的分类变量 城市 五个之一 职业 四种之一 血型 四种之一 到目前为止 我已经成功地以一种我认为易于使用的方式对数据进行了分组 import numpy as np pandas as pd Make data
  • Spyder 导入模块出错

    我正在尝试在 Spyder 中使用 sklearn 一开始 当我尝试导入它时 我收到 ImportError No module named sklearn 然后我用 PYTHONPATH 管理器设置 PATH 然后使用工具菜单中的 更新模
  • 如何从 Lua 调用 Python 函数?

    我想从我的 lua 文件运行 python 脚本 我怎样才能实现这个目标 Example Python代码 sum py file def sum from python a b return a b Lua code main lua f
  • WinSock.h 和 WinSock2.h 使用哪个?

    有谁知道 WinSock h 和 WinSock2 h 之间的区别 我知道它们不使用相同的库 lib 但我不知道 WinSock2 是否仅添加了新功能 或者是否还改进了 WinSock 1 功能 我正在使用 IP TCP 套接字 并希望使用
  • python 脚本中 os.system 的 256 和 512 响应代码是什么

    当我在 python 中使用 os system ping 服务器时 我得到多个响应代码 使用的命令 os system ping q c 30 s SERVERANME 0 在线 256 离线 512 512 是什么意思 Per the
  • 在 vim 折叠线中语法高亮 Python

    我发现代码折叠 http en wikipedia org wiki Code folding帮助我更好地组织我的文件 因此 在我的底部 vimrc 我启用vim代码折叠 http vimdoc sourceforge net htmldo
  • 使用 boto3 从 s3 下载时使用 filename 作为文件名

    我正在使用 boto3 上传文件 如下所示 client boto3 client s3 aws access key id id aws secret access key key client upload file tmp test
  • 如何在Python中求和

    我想知道如何在 python 中表示总和而不需要像这样的循环here http docs scipy org doc scipy reference tutorial optimize html 我们有 def rosen x The Ro
  • 根据给定列表中的值替换列中的值[重复]

    这个问题在这里已经有答案了 我在数据框中有一列 仅允许定义列表中存在的值 例如 给定列表 l1 1 2 5 6 如果列表中不存在列中的值 我需要将每个值替换为 0 column Expected column 1 1 5 5 2 2 3 0
  • Python,多线程,获取网页,下载网页

    我想在一个站点批量下载网页 我的 urls txt 文件中有 5000000 个 url 链接 大约有300M 如何让多线程链接这些网址并下载这些网页 或者如何批量下载这些网页 我的想法 with open urls txt r as f
  • 使 np.loadtxt 使用多个可能的分隔符

    我有一个程序可以读取数据文件 用户可以选择他们想要使用的列 我希望它对于输入文件更加通用 有时 列可能如下所示 10 34 24 58 8 284 6 121 有时它们可 能看起来像这样 10 34 24 58 8 284 6 121 我希
  • 如何可视化多维数据上的 kmeans 聚类

    我在 mnist 数据集上使用 kmeans 聚类算法 并希望可视化聚类后的图 到目前为止我做了这个 from mnist import MNIST mndata MNIST Datasets X train y train mndata
  • 如何限制scrapy请求对象?

    所以我有一个蜘蛛 我认为它正在泄漏内存 结果当我检查 telnet 控制台 gt gt gt prefs 时 它只是从链接丰富的页面中抓取了太多链接 有时它会超过 100 000 个 现在我已经一遍又一遍地浏览文档和谷歌 但我找不到一种方法
  • 有适用于 Windows 的 Bonjour SDK 吗?

    我想知道如何在 Windows 上实现 bonjour 以便我可以在 Windows 上设置服务器并使用 iphone 客户端 中的 bonjour 服务访问 Windows 服务器 中的文件 谁能告诉我我们是否有适用于 Windows 的
  • 如何保持 python 3 脚本 (Bot) 运行

    不是母语英语 抱歉 英语可能很蹩脚 我也是编程新手 您好 我正在尝试使用 QueryServer 连接到 TeamSpeak 服务器来创建机器人 经过几天的努力 它有效 只有 1 个问题 而我却被这个问题困扰了 如果您需要检查 这是我正在使
  • VSCode无法切换matplotlib后端:ImportError:无法加载需要“qt5”交互框架的后端“Qt5Agg”

    我只想通过在 VSCode 中运行 Python 来进行绘图 但结果失败了 我无法将后端从 agg 切换到 Qt5Agg 但是 我可以在 VSCode 的终端中轻松执行此操作 VSCode集成终端中的问题如下所示 我尝试了各种解决方案但失败

随机推荐