2014-03-12 116 views
9

我想设置我的Django变体(W)),但安装所需的枕头时出现问题。枕头安装错误:命令'gcc'失败,退出状态1

背景:正在运行Python 2.6.6,在virtualenv,使用Mac终端必须托管在一个小的橙色,no root access域shell访问,不能使用sudo命令

当我运行

pip install Pillow 

我得到以下错误:

Downloading/unpacking Pillow 
    Downloading Pillow-2.3.0.zip (2.4MB): 2.4MB downloaded 
    Running setup.py (path:/home/clarayee/.env/env/build/Pillow/setup.py) egg_info for package Pillow 
    Installing collected packages: Pillow 
    Running setup.py install for Pillow 
    building 'PIL._imaging' extension 
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/usr/include/freetype2 -I/home/clarayee/.env/env/build/Pillow/libImaging -I/home/clarayee/.env/env/include -I/usr/local/include -I/usr/include -I/usr/include/python2.6 -c _imaging.c -o build/temp.linux-x86_64-2.6/_imaging.o 
    unable to execute gcc: Permission denied 
    error: command 'gcc' failed with exit status 1 
    Complete output from command /home/clarayee/.env/env/bin/python -c "import setuptools, tokenize;__file__='/home/clarayee/.env/env/build/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-nCrvqa-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/clarayee/.env/env/include/site/python2.6: 
    running install 

running build 

running build_py 

creating build 

creating build/lib.linux-x86_64-2.6 

creating build/lib.linux-x86_64-2.6/PIL 

copying PIL/MicImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/TiffTags.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageWin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageFileIO.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/SunImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImagePalette.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ArgImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/Image.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/PngImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImagePath.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageFile.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageMath.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/PcfFontFile.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageTk.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/GdImageFile.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/__init__.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/_util.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/MspImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/FliImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageEnhance.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/TarIO.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageColor.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/BdfFontFile.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/JpegPresets.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/GimpGradientFile.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageQt.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageCms.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/CurImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageMode.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageChops.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ContainerIO.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/GifImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/WalImageFile.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageDraw2.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageFont.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageOps.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/OleFileIO.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/PSDraw.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageTransform.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageDraw.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/FontFile.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ExifTags.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageFilter.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageShow.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageSequence.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/PaletteFile.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageStat.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/_binary.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/tests.py -> build/lib.linux-x86_64-2.6/PIL 

copying PIL/ImageGrab.py -> build/lib.linux-x86_64-2.6/PIL 

running egg_info 

writing dependency_links to Pillow.egg-info/dependency_links.txt 

writing Pillow.egg-info/PKG-INFO 

writing top-level names to Pillow.egg-info/top_level.txt 

warning: manifest_maker: standard file '-c' not found 

reading manifest file 'Pillow.egg-info/SOURCES.txt' 

reading manifest template 'MANIFEST.in' 

writing manifest file 'Pillow.egg-info/SOURCES.txt' 

running build_ext 

building 'PIL._imaging' extension 

creating build/temp.linux-x86_64-2.6/libImaging 

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/usr/include/freetype2 -I/home/clarayee/.env/env/build/Pillow/libImaging -I/home/clarayee/.env/env/include -I/usr/local/include -I/usr/include -I/usr/include/python2.6 -c _imaging.c -o build/temp.linux-x86_64-2.6/_imaging.o 

unable to execute gcc: Permission denied 

error: command 'gcc' failed with exit status 1 

---------------------------------------- 
Cleaning up... 
Command /home/clarayee/.env/env/bin/python -c "import setuptools, tokenize;__file__='/home/clarayee/.env/env/build/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-nCrvqa-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/clarayee/.env/env/include/site/python2.6 failed with error code 1 in /home/clarayee/.env/env/build/Pillow 
Storing debug log for failure in /home/clarayee/.pip/pip.log 

与我运行easy_install时相同的问题。将感谢任何帮助!

+1

'无法执行GCC:权限denied'。询问托管提供为您运行您的命令。 –

+0

啊,会做到这一点,并报告回来。谢谢! – moshushi

+0

1.您不需要root来安装'virtualenv' 2.'gcc --version'显示的是什么? 3.什么在'/ home/clarayee/.pip/pip.log'中? – jfs

回答

1

解决。 Priyank Patel是对的......这是服务器端许可问题。谢谢你们!

无法执行gcc:权限被拒绝。询问托管提供为您运行您的命令。 - Priyank Patel昨天

+2

什么是解决方案 – timberlake

3

尝试在终端运行以下命令:

export CFLAGS=-Qunused-arguments 
export CPPFLAGS=-Qunused-arguments 

然后pip install Pillow

+2

嗯...试过了,仍然是同样的结果清理... 命令/home/clarayee/.env/env/bin/python -c”import setuptools,tokenize; __ file__ ='/ home/clarayee/.env/env/build/Pillow/setup.py'; exec(compile(getattr(tokenize,'open',open)(__ file __).read().export('\ r \ n ','\ n'),__file__,'exec'))“install --record /tmp/pip-eL8ahy-record/install-record.txt --single-version-external-managed -compile --install-头文件/home/clarayee/.env/env/include/site/p ython2.6失败,错误代码1在/home/clarayee/.env/env/build/Pillow 在/home/clarayee/.pip/pip.log中存储调试日志失败 ' – moshushi

+1

这应该真的有效..我尝试过这一年前.. – Leonid

10

我有一个类似的问题(gcc失败,但没有提及权限),但它是依赖关系,这是我的问题。顺便说一下,我的任务是将Pillow安装在树莓派上,这就是为什么这些开发库是必需的。他们可能不需要你。我想,这是蟒蛇成像命令最有用的技巧。下面是我所做的:

# Add the deb-src for each deb in /etc/apt/sources list 
sudo apt-get update 
sudo apt-get install python2.7-dev tk8.5 tcl8.5 tk8.5-dev tcl8.5-dev 
sudo apt-get build-dep python-imaging --fix-missing 
sudo pip install Pillow 

来源: https://github.com/python-imaging/Pillow/issues/322 http://forums.getpebble.com/discussion/8490/ubuntu-install-problem-when-it-comes-to-pip https://unix.stackexchange.com/questions/105265/install-pil-pillow-via-pip-in-debian-testing-jessie

0

你有目录来执行它。

4

如果这有助于其他人。这可能是服务提供商所做的。

在CentOS上,我最终不得不安装Python头来解决这个问题。

yum install python-devel 

然后

pip install Pillow 
+0

+1这一个让我两次!对于Ubuntu,运行'sudo apt-get install python-dev',然后安装'Pillow'运行平稳,至少在我的情况下是:'pip install pillow'。 – nicorellius

19

请确保您有GCC和python-dev的安装

sudo apt-get install gcc python-dev

+0

为我工作:) – Dave

+4

'sudo apt-get安装gcc python3.4-dev' for python3.4 –

+0

'gcc'特别是我的关键 - 你只是假设它在那里! – py4on

相关问题