我在安装Pillow时遇到了麻烦。 这是完整的追溯:
Collecting Pillow
Using cached Pillow-4.0.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting olefile (from Pillow)
Using cached olefile-0.44.zip
Installing collected packages: olefile, Pillow
Running setup.py install for olefile ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-build-UyBMYN/olefile/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-QHsEXV-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
copying OleFileIO_PL.py -> build/lib
creating build/lib/olefile
copying olefile/__init__.py -> build/lib/olefile
copying olefile/olefile.py -> build/lib/olefile
copying olefile/README.rst -> build/lib/olefile
copying olefile/README.html -> build/lib/olefile
copying olefile/LICENSE.txt -> build/lib/olefile
copying olefile/CONTRIBUTORS.txt -> build/lib/olefile
running install_lib
creating /Library/Python/2.7/site-packages/olefile
error: could not create '/Library/Python/2.7/site-packages/olefile': Permission denied
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-build-UyBMYN/olefile/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-QHsEXV-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-build-UyBMYN/olefile/
错误似乎是“权限被拒绝”#39;在尝试创建文件夹时;虽然我不明白为什么......
我的机器正在运行Mac OSX,我正在使用终端来运行这个Django项目的命令。
答案 0 :(得分:1)
因为普通用户无权全局安装软件包。使用sudo
运行,或者 - 更好 - 使用virtualenv并在那里安装包。
答案 1 :(得分:0)
关于这个问题有几个问题,我建议你看看这些:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>commons-compiler</artifactId>
<version>2.7.8</version>
</dependency>
</dependencies>
</dependencyManagement>
https://stackoverflow.com/a/19472082/394647 virtualenv
https://stackoverflow.com/a/7143496/394647 我更喜欢第二个,但它也取决于你的项目/应用程序结构