【问题标题】:Problems when installing goose安装goose时的问题
【发布时间】:2015-03-24 20:53:54
【问题描述】:

我在安装 goose 时遵循了 https://github.com/grangier/python-goose 的确切说明,在我输入“mkvirtualenv --no-site-packages goose”后,我得到了:

172-27-220-167:~ yitongwang$ mkvirtualenv --no-site-packages goose
New python executable in goose/bin/python
Installing setuptools, pip...done.
Error: deactivate must be sourced. Run 'source deactivate'
instead of 'deactivate'.
Usage: source deactivate
removes the 'bin' directory of the environment activated with 'source
activate' from PATH. 
(goose)172-27-220-167:~ yitongwang$

我已经使用 'sudo pip install virtualenv/virtualenvwrapper' 安装了 virtualenv 和 virtualenvwrapper,最奇怪的是我似乎仍然设法进入 goose 虚拟环境(似乎是这样)。克隆到 git repo 并切换到之前克隆的目录 python-goose 后,我尝试运行 'pip install -r requirements.txt' 和 'python setup.py install',这些是错误:

In file included from _imagingft.c:31:

/Users/yitongwang/anaconda/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found

#include <freetype/config/ftheader.h>

         ^

1 error generated.

Building using 4 processes

gcc -bundle -undefined dynamic_lookup -L/Users/yitongwang/anaconda/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/_imagingft.o -L/Users/yitongwang/.virtualenvs/goose/lib -L/usr/local/lib -L/usr/local/Cellar/freetype/2.5.5/lib -L/usr/lib -L/Users/yitongwang/anaconda/lib -lfreetype -o build/lib.macosx-10.5-x86_64-2.7/PIL/_imagingft.so

clang: error: no such file or directory: 'build/temp.macosx-10.5-x86_64-2.7/_imagingft.o'

error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/Users/yitongwang/.virtualenvs/goose/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/64/dhzf31k50zg22rbgbz79c3dw0000gn/T/pip-build-nL0d0r/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/64/dhzf31k50zg22rbgbz79c3dw0000gn/T/pip-k7HUgC-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/yitongwang/.virtualenvs/goose/include/site/python2.7" failed with error code 1 in /private/var/folders/64/dhzf31k50zg22rbgbz79c3dw0000gn/T/pip-build-nL0d0r/Pillow

    In file included from _imagingft.c:31:
/Users/yitongwang/anaconda/include/ft2build.h:56:10: fatal error: 
      'freetype/config/ftheader.h' file not found
#include <freetype/config/ftheader.h>
         ^
1 error generated.
clang: error: no such file or directory: 'build/temp.macosx-10.5-x86_64-2.7/_imagingft.o'
error: Setup script exited with error: command 'gcc' failed with exit status 1

我不确定具体出了什么问题,因为我从头开始尝试了几次,我删除了目录“python-goose”和“./virtualenv”以及来自 .bash_profile 的路径。

任何帮助将不胜感激!

谢谢

附:我正在使用带有 Python 2.7 的 Anaconda。

【问题讨论】:

    标签: python anaconda goose


    【解决方案1】:

    Take a look at this.这里也突出显示了同样的问题。它与 /usr/local/bin/virtualenvwrapper.sh 中的 workon 并调用 deactivate 但 anaconda bin 目录中的脚本也做同样的事情有关。

    【讨论】:

      【解决方案2】:

      尝试使用 conda (conda create) 创建一个环境,而不是使用 virtualenv,并将所有 goose 依赖项安装到其中(显然 freetype 就是其中之一)。然后将 goose 直接安装到该环境中。类似于conda create -n goose freetype ...(将... 替换为goose 的other dependencies)、source activate goose、python setup.py install(来自 goose 目录)。

      【讨论】:

        【解决方案3】:

        在你的命令提示符下写 pip install goose-extractor

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2022-01-06
          • 2013-07-14
          • 1970-01-01
          • 2023-03-12
          • 1970-01-01
          • 1970-01-01
          • 2022-08-11
          • 1970-01-01
          相关资源
          最近更新 更多