在安装python模块JsonGraph(https://pypi.org/project/jsongraph/)时遇到问题。 我之前必须手动安装pyicu,但找不到解决方法。
我在MacOsx Mojave 10.14上 我做pip install jsongraph,这是我收到的错误消息:
➜ ~ pip install jsongraph
Collecting jsongraph
Requirement already satisfied: jsonmapping in
/usr/local/lib/python3.7/site-packages (from jsongraph) (0.7.4)
Requirement already satisfied: pyyaml in /usr/local/lib/python3.7/site-packages (from jsongraph) (5.1.1)
Requirement already satisfied: normality in /usr/local/lib/python3.7/site-packages (from jsongraph) (1.0.1)
Requirement already satisfied: jsonschema in /usr/local/lib/python3.7/site-packages (from jsongraph) (3.0.2)
Collecting url (from jsongraph)
Using cached https://files.pythonhosted.org/packages/58/1d/492737ab1ed4ed33ce5bc00a54e92b6ad26aa793cceed097a7af389c22b3/url-0.4.2.tar.gz
Requirement already satisfied: six in /usr/local/lib/python3.7/site-packages (from jsongraph) (1.12.0)
Collecting rdflib (from jsongraph)
Using cached https://files.pythonhosted.org/packages/3c/fe/630bacb652680f6d481b9febbb3e2c3869194a1a5fc3401a4a41195a2f8f/rdflib-4.2.2-py3-none-any.whl
Requirement already satisfied: requests>=2.0 in /usr/local/lib/python3.7/site-packages (from jsongraph) (2.21.0)
Collecting sparqlquery (from jsongraph)
Requirement already satisfied: mqlparser in /usr/local/lib/python3.7/site-packages (from jsongraph) (0.1)
Requirement already satisfied: networkx in /usr/local/lib/python3.7/site-packages (from jsonmapping->jsongraph) (2.3)
Requirement already satisfied: unidecode in /usr/local/lib/python3.7/site-packages (from jsonmapping->jsongraph) (1.1.1)
Requirement already satisfied: typecast in /usr/local/lib/python3.7/site-packages (from jsonmapping->jsongraph) (0.3.3)
Requirement already satisfied: chardet in /usr/local/lib/python3.7/site-packages (from normality->jsongraph) (3.0.4)
Requirement already satisfied: pyicu>=1.9.3 in /usr/local/lib/python3.7/site-packages (from normality->jsongraph) (2.3.1)
Requirement already satisfied: banal>=0.4.1 in /usr/local/lib/python3.7/site-packages (from normality->jsongraph) (0.4.2)
Requirement already satisfied: pyrsistent>=0.14.0 in /usr/local/lib/python3.7/site-packages (from jsonschema->jsongraph) (0.15.4)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.7/site-packages (from jsonschema->jsongraph) (19.1.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/site-packages (from jsonschema->jsongraph) (41.0.1)
Collecting isodate (from rdflib->jsongraph)
Using cached https://files.pythonhosted.org/packages/9b/9f/b36f7774ff5ea8e428fdcfc4bb332c39ee5b9362ddd3d40d9516a55221b2/isodate-0.6.0-py2.py3-none-any.whl
Requirement already satisfied: pyparsing in /usr/local/lib/python3.7/site-packages (from rdflib->jsongraph) (2.4.2)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.7/site-packages (from requests>=2.0->jsongraph) (1.24.1)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.7/site-packages (from requests>=2.0->jsongraph) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/site-packages (from requests>=2.0->jsongraph) (2018.8.24)
Requirement already satisfied: decorator>=4.3.0 in /usr/local/lib/python3.7/site-packages (from networkx->jsonmapping->jsongraph) (4.4.0)
Requirement already satisfied: python-dateutil>=1.5 in /usr/local/lib/python3.7/site-packages (from typecast->jsonmapping->jsongraph) (2.8.0)
Building wheels for collected packages: url
Building wheel for url (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ml/vjvql68j4p381jc_qjhcmy0c0000gn/T/pip-install-arnxkc6y/url/setup.py'"'"'; __file__='"'"'/private/var/folders/ml/vjvql68j4p381jc_qjhcmy0c0000gn/T/pip-install-arnxkc6y/url/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/ml/vjvql68j4p381jc_qjhcmy0c0000gn/T/pip-wheel-wv4hxpxs --python-tag cp37
cwd: /private/var/folders/ml/vjvql68j4p381jc_qjhcmy0c0000gn/T/pip-install-arnxkc6y/url/
Complete output (57 lines):
Building from C++
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/url
copying url/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/url
creating build/lib.macosx-10.14-x86_64-3.7/url/psl
copying url/psl/2016-08-16.psl -> build/lib.macosx-10.14-x86_64-3.7/url/psl
running build_ext
building 'url.url' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/url
creating build/temp.macosx-10.14-x86_64-3.7/url/url-cpp
creating build/temp.macosx-10.14-x86_64-3.7/url/url-cpp/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Iurl/url-cpp/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c url/url-cpp/src/url.cpp -o build/temp.macosx-10.14-x86_64-3.7/url/url-cpp/src/url.o -std=c++11
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Iurl/url-cpp/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c url/url-cpp/src/utf8.cpp -o build/temp.macosx-10.14-x86_64-3.7/url/url-cpp/src/utf8.o -std=c++11
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Iurl/url-cpp/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c url/url-cpp/src/punycode.cpp -o build/temp.macosx-10.14-x86_64-3.7/url/url-cpp/src/punycode.o -std=c++11
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Iurl/url-cpp/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c url/url-cpp/src/psl.cpp -o build/temp.macosx-10.14-x86_64-3.7/url/url-cpp/src/psl.o -std=c++11
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Iurl/url-cpp/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c url/url.cpp -o build/temp.macosx-10.14-x86_64-3.7/url/url.o -std=c++11
url/url.cpp:12497:24: error: no member named 'exc_type' in '_ts'
tmp_type = tstate->exc_type;
~~~~~~ ^
url/url.cpp:12498:25: error: no member named 'exc_value' in '_ts'; did you mean 'curexc_value'?
tmp_value = tstate->exc_value;
^~~~~~~~~
curexc_value
/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
PyObject *curexc_value;
^
url/url.cpp:12499:22: error: no member named 'exc_traceback' in '_ts'; did you mean 'curexc_traceback'?
tmp_tb = tstate->exc_traceback;
^~~~~~~~~~~~~
curexc_traceback
/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
PyObject *curexc_traceback;
^
url/url.cpp:12500:13: error: no member named 'exc_type' in '_ts'
tstate->exc_type = *type;
~~~~~~ ^
url/url.cpp:12501:13: error: no member named 'exc_value' in '_ts'; did you mean 'curexc_value'?
tstate->exc_value = *value;
^~~~~~~~~
curexc_value
/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
PyObject *curexc_value;
^
url/url.cpp:12502:13: error: no member named 'exc_traceback' in '_ts'; did you mean 'curexc_traceback'?
tstate->exc_traceback = *tb;
^~~~~~~~~~~~~
curexc_traceback
/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
PyObject *curexc_traceback;
^
6 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for url
Running setup.py clean for url
Failed to build url
Installing collected packages: url, isodate, rdflib, sparqlquery, jsongraph
Running setup.py install for url ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ml/vjvql68j4p381jc_qjhcmy0c0000gn/T/pip-install-arnxkc6y/url/setup.py'"'"'; __file__='"'"'/private/var/folders/ml/vjvql68j4p381jc_qjhcmy0c0000gn/T/pip-install-arnxkc6y/url/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/var/folders/ml/vjvql68j4p381jc_qjhcmy0c0000gn/T/pip-record-z1mqv7uq/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/ml/vjvql68j4p381jc_qjhcmy0c0000gn/T/pip-install-arnxkc6y/url/
Complete output (57 lines):
Building from C++
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/url
copying url/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/url
creating build/lib.macosx-10.14-x86_64-3.7/url/psl
copying url/psl/2016-08-16.psl -> build/lib.macosx-10.14-x86_64-3.7/url/psl
running build_ext
building 'url.url' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/url
creating build/temp.macosx-10.14-x86_64-3.7/url/url-cpp
creating build/temp.macosx-10.14-x86_64-3.7/url/url-cpp/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Iurl/url-cpp/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c url/url-cpp/src/url.cpp -o build/temp.macosx-10.14-x86_64-3.7/url/url-cpp/src/url.o -std=c++11
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Iurl/url-cpp/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c url/url-cpp/src/utf8.cpp -o build/temp.macosx-10.14-x86_64-3.7/url/url-cpp/src/utf8.o -std=c++11
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Iurl/url-cpp/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c url/url-cpp/src/punycode.cpp -o build/temp.macosx-10.14-x86_64-3.7/url/url-cpp/src/punycode.o -std=c++11
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Iurl/url-cpp/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c url/url-cpp/src/psl.cpp -o build/temp.macosx-10.14-x86_64-3.7/url/url-cpp/src/psl.o -std=c++11
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Iurl/url-cpp/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c url/url.cpp -o build/temp.macosx-10.14-x86_64-3.7/url/url.o -std=c++11
url/url.cpp:12497:24: error: no member named 'exc_type' in '_ts'
tmp_type = tstate->exc_type;
~~~~~~ ^
url/url.cpp:12498:25: error: no member named 'exc_value' in '_ts'; did you mean 'curexc_value'?
tmp_value = tstate->exc_value;
^~~~~~~~~
curexc_value
/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
PyObject *curexc_value;
^
url/url.cpp:12499:22: error: no member named 'exc_traceback' in '_ts'; did you mean 'curexc_traceback'?
tmp_tb = tstate->exc_traceback;
^~~~~~~~~~~~~
curexc_traceback
/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
PyObject *curexc_traceback;
^
url/url.cpp:12500:13: error: no member named 'exc_type' in '_ts'
tstate->exc_type = *type;
~~~~~~ ^
url/url.cpp:12501:13: error: no member named 'exc_value' in '_ts'; did you mean 'curexc_value'?
tstate->exc_value = *value;
^~~~~~~~~
curexc_value
/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
PyObject *curexc_value;
^
url/url.cpp:12502:13: error: no member named 'exc_traceback' in '_ts'; did you mean 'curexc_traceback'?
tstate->exc_traceback = *tb;
^~~~~~~~~~~~~
curexc_traceback
/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
PyObject *curexc_traceback;
^
6 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ml/vjvql68j4p381jc_qjhcmy0c0000gn/T/pip-install-arnxkc6y/url/setup.py'"'"'; __file__='"'"'/private/var/folders/ml/vjvql68j4p381jc_qjhcmy0c0000gn/T/pip-install-arnxkc6y/url/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/var/folders/ml/vjvql68j4p381jc_qjhcmy0c0000gn/T/pip-record-z1mqv7uq/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
谢谢您的帮助。