在MacOS Moj中安装ucl时出错

2024-05-20 11:12:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我有安装在MacOS Mojave上的问题。 我需要一个ucl图书馆在我的项目。我不懂Python。我需要运行一次就绪代码。 当我尝试时:

MBP-ukasz:psCMS2 lukasz$ sudo pip install ucl

我有个错误:

The directory '/Users/lukasz/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/lukasz/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting ucl
  Downloading https://files.pythonhosted.org/packages/53/a5/fedfc8af32519d2fb172736b7b101239004ae30bdcc036a7c1fdeb152927/ucl-0.8.1.tar.gz
Installing collected packages: ucl
  Running setup.py install for ucl ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-DBLg7v/ucl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-huMBs9/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'ucl' extension
    creating build
    creating build/temp.macosx-10.14-intel-2.7
    creating build/temp.macosx-10.14-intel-2.7/src
    cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/uclmodule.c -o build/temp.macosx-10.14-intel-2.7/src/uclmodule.o
    src/uclmodule.c:2:10: fatal error: 'ucl.h' file not found
    #include <ucl.h>
             ^~~~~~~
    1 error generated.
    error: command 'cc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-DBLg7v/ucl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-huMBs9/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-DBLg7v/ucl/

我该怎么修?你知道吗


Tags: installpipandthebuildwithsudocode