gpt4 book ai didi

python - Windows 上的 VirtualEnv,pip 无法安装带有 C 扩展的包

转载 作者:太空宇宙 更新时间:2023-11-03 11:56:13 27 4
gpt4 key购买 nike

我正在尝试进行一些现代化改造,但无论出于何种原因,pip 都无法安装带有 C 扩展名的任何内容。令人讨厌的罪犯是 MySQLdb、PIL、Fabric。我可以使用 exe 安装它们,但现代需求技术不起作用。

例如,这是 PIL 所做的(virtualtesting 是环境,其中还没有其他任何东西):

(virtualtesting) C:\Users\jgoldstein\Localhost\virtualtesting>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
error: Unable to find vcvarsall.bat
Complete output from command C:\Users\jgoldstein\Localhost\virtualtesting\Scripts\python.exe -c "import setuptools;__file__='C:\\Users\\jgoldstein\\Localhost\\virtualtesting\\build\\pil\\setup.py';exec(compile(open(__file__).read().replace('\r\n',
'\n'), __file__, 'exec'))" install --single-version-externally-managed --record c:\users\jgolds~1\appdata\local\temp\pip-wbez3q-record\install-record.txt --install-headers C:\Users\jgoldstein\Localhost\virtualtesting\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.win32-2.7

copying PIL\ArgImagePlugin.py -> build\lib.win32-2.7

copying PIL\BdfFontFile.py -> build\lib.win32-2.7

copying PIL\BmpImagePlugin.py -> build\lib.win32-2.7

copying PIL\BufrStubImagePlugin.py -> build\lib.win32-2.7

copying PIL\ContainerIO.py -> build\lib.win32-2.7

copying PIL\CurImagePlugin.py -> build\lib.win32-2.7

copying PIL\DcxImagePlugin.py -> build\lib.win32-2.7

copying PIL\EpsImagePlugin.py -> build\lib.win32-2.7

copying PIL\ExifTags.py -> build\lib.win32-2.7

copying PIL\FitsStubImagePlugin.py -> build\lib.win32-2.7

copying PIL\FliImagePlugin.py -> build\lib.win32-2.7

copying PIL\FontFile.py -> build\lib.win32-2.7

copying PIL\FpxImagePlugin.py -> build\lib.win32-2.7

copying PIL\GbrImagePlugin.py -> build\lib.win32-2.7

copying PIL\GdImageFile.py -> build\lib.win32-2.7

copying PIL\GifImagePlugin.py -> build\lib.win32-2.7

copying PIL\GimpGradientFile.py -> build\lib.win32-2.7

copying PIL\GimpPaletteFile.py -> build\lib.win32-2.7

copying PIL\GribStubImagePlugin.py -> build\lib.win32-2.7

copying PIL\Hdf5StubImagePlugin.py -> build\lib.win32-2.7

copying PIL\IcnsImagePlugin.py -> build\lib.win32-2.7

copying PIL\IcoImagePlugin.py -> build\lib.win32-2.7

copying PIL\Image.py -> build\lib.win32-2.7

copying PIL\ImageChops.py -> build\lib.win32-2.7

copying PIL\ImageCms.py -> build\lib.win32-2.7

copying PIL\ImageColor.py -> build\lib.win32-2.7

copying PIL\ImageDraw.py -> build\lib.win32-2.7

copying PIL\ImageDraw2.py -> build\lib.win32-2.7

copying PIL\ImageEnhance.py -> build\lib.win32-2.7

copying PIL\ImageFile.py -> build\lib.win32-2.7

copying PIL\ImageFileIO.py -> build\lib.win32-2.7

copying PIL\ImageFilter.py -> build\lib.win32-2.7

copying PIL\ImageFont.py -> build\lib.win32-2.7

copying PIL\ImageGL.py -> build\lib.win32-2.7

copying PIL\ImageGrab.py -> build\lib.win32-2.7

copying PIL\ImageMath.py -> build\lib.win32-2.7

copying PIL\ImageMode.py -> build\lib.win32-2.7

copying PIL\ImageOps.py -> build\lib.win32-2.7

copying PIL\ImagePalette.py -> build\lib.win32-2.7

copying PIL\ImagePath.py -> build\lib.win32-2.7

copying PIL\ImageQt.py -> build\lib.win32-2.7

copying PIL\ImageSequence.py -> build\lib.win32-2.7

copying PIL\ImageShow.py -> build\lib.win32-2.7

copying PIL\ImageStat.py -> build\lib.win32-2.7

copying PIL\ImageTk.py -> build\lib.win32-2.7

copying PIL\ImageTransform.py -> build\lib.win32-2.7

copying PIL\ImageWin.py -> build\lib.win32-2.7

copying PIL\ImImagePlugin.py -> build\lib.win32-2.7

copying PIL\ImtImagePlugin.py -> build\lib.win32-2.7

copying PIL\IptcImagePlugin.py -> build\lib.win32-2.7

copying PIL\JpegImagePlugin.py -> build\lib.win32-2.7

copying PIL\McIdasImagePlugin.py -> build\lib.win32-2.7

copying PIL\MicImagePlugin.py -> build\lib.win32-2.7

copying PIL\MpegImagePlugin.py -> build\lib.win32-2.7

copying PIL\MspImagePlugin.py -> build\lib.win32-2.7

copying PIL\OleFileIO.py -> build\lib.win32-2.7

copying PIL\PaletteFile.py -> build\lib.win32-2.7

copying PIL\PalmImagePlugin.py -> build\lib.win32-2.7

copying PIL\PcdImagePlugin.py -> build\lib.win32-2.7

copying PIL\PcfFontFile.py -> build\lib.win32-2.7

copying PIL\PcxImagePlugin.py -> build\lib.win32-2.7

copying PIL\PdfImagePlugin.py -> build\lib.win32-2.7

copying PIL\PixarImagePlugin.py -> build\lib.win32-2.7

copying PIL\PngImagePlugin.py -> build\lib.win32-2.7

copying PIL\PpmImagePlugin.py -> build\lib.win32-2.7

copying PIL\PsdImagePlugin.py -> build\lib.win32-2.7

copying PIL\PSDraw.py -> build\lib.win32-2.7

copying PIL\SgiImagePlugin.py -> build\lib.win32-2.7

copying PIL\SpiderImagePlugin.py -> build\lib.win32-2.7

copying PIL\SunImagePlugin.py -> build\lib.win32-2.7

copying PIL\TarIO.py -> build\lib.win32-2.7

copying PIL\TgaImagePlugin.py -> build\lib.win32-2.7

copying PIL\TiffImagePlugin.py -> build\lib.win32-2.7

copying PIL\TiffTags.py -> build\lib.win32-2.7

copying PIL\WalImageFile.py -> build\lib.win32-2.7

copying PIL\WmfImagePlugin.py -> build\lib.win32-2.7

copying PIL\XbmImagePlugin.py -> build\lib.win32-2.7

copying PIL\XpmImagePlugin.py -> build\lib.win32-2.7

copying PIL\XVThumbImagePlugin.py -> build\lib.win32-2.7

copying PIL\__init__.py -> build\lib.win32-2.7

running build_ext

building '_imaging' extension

error: Unable to find vcvarsall.bat

----------------------------------------
Command C:\Users\jgoldstein\Localhost\virtualtesting\Scripts\python.exe -c "import setuptools;__file__='C:\\Users\\jgoldstein\\Localhost\\virtualtesting\\build\\pil\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record c:\users\jgolds~1\appdata\local\temp\pip-wbez3q-record\install-record.txt --install-headers C:\Users\jgoldstein\Localhost\virtualtesting\include\site\python2.7 failed with error code 1
Storing complete log in C:\Users\jgoldstein\AppData\Roaming\pip\pip.log

它是 Python 2.7(32 位)、VirtualEnv 1.7、Windows 7(64 位)。我……很干。

那么第一个问题:这可以修复吗?

第二个问题:似乎如果我运行 exe 安装程序到主站点包并将结果复制到 VirtualEnv 的目录中,它就可以正常工作。如果我想转到 pip+requirements.txt 模型做事,这样做有多糟糕?

(显然,在服务器上所有这些东西都运行良好。)

最佳答案

对于第一个问题,请看: error: Unable to find vcvarsall.bat

无法回答第二个问题,我不知道:|

关于python - Windows 上的 VirtualEnv,pip 无法安装带有 C 扩展的包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9269427/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com