我正在尝试在蟒蛇内执行pip install
,即在激活环境的情况下。当我之前将包装与anaconda 2一起安装时,它工作正常。当我对anaconda 3进行相同的安装时,出现以下错误。有没有办法:
(a)即使已安装anaconda 3,也使用anaconda 2吗? (b)完全降级为Anaconda 2,并从头开始? (c)避免此C ++错误?
这是错误,以防万一:
(lm_1b) vpn-165-124-160-218:~ adamg$ pip install https://github.com/kpu/kenlm/archive/master.zip
Collecting https://github.com/kpu/kenlm/archive/master.zip
Downloading https://github.com/kpu/kenlm/archive/master.zip (526kB)
100% |████████████████████████████████| 532kB 1.1MB/s
Building wheels for collected packages: kenlm
Running setup.py bdist_wheel for kenlm ... error
Complete output from command /Users/adamg/anaconda3/envs/lm_1b/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/2l/hd8b8vx566ld71lfd8hjglbc0000gn/T/pip-req-build-bkyn5o51/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/2l/hd8b8vx566ld71lfd8hjglbc0000gn/T/pip-wheel-vbsheajs --python-tag cp36:
running bdist_wheel
running build
running build_ext
building 'kenlm' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/util
creating build/temp.macosx-10.9-x86_64-3.6/lm
creating build/temp.macosx-10.9-x86_64-3.6/util/double-conversion
creating build/temp.macosx-10.9-x86_64-3.6/python
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/adamg/anaconda3/envs/lm_1b/include -arch x86_64 -I/Users/adamg/anaconda3/envs/lm_1b/include -arch x86_64 -I. -I/Users/adamg/anaconda3/envs/lm_1b/include/python3.6m -c util/pool.cc -o build/temp.macosx-10.9-x86_64-3.6/util/pool.o -O3 -DNDEBUG -DKENLM_MAX_ORDER=6 -std=c++11
In file included from util/pool.cc:1:
In file included from ./util/pool.hh:4:
/Users/adamg/anaconda3/envs/lm_1b/include/c++/v1/cassert:21:10: fatal error: 'assert.h' file not found
#include <assert.h>
^~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Failed building wheel for kenlm
Running setup.py clean for kenlm
Failed to build kenlm
Installing collected packages: kenlm
Running setup.py install for kenlm ... error
Complete output from command /Users/adamg/anaconda3/envs/lm_1b/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/2l/hd8b8vx566ld71lfd8hjglbc0000gn/T/pip-req-build-bkyn5o51/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/2l/hd8b8vx566ld71lfd8hjglbc0000gn/T/pip-record-74c181ep/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'kenlm' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/util
creating build/temp.macosx-10.9-x86_64-3.6/lm
creating build/temp.macosx-10.9-x86_64-3.6/util/double-conversion
creating build/temp.macosx-10.9-x86_64-3.6/python
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/adamg/anaconda3/envs/lm_1b/include -arch x86_64 -I/Users/adamg/anaconda3/envs/lm_1b/include -arch x86_64 -I. -I/Users/adamg/anaconda3/envs/lm_1b/include/python3.6m -c util/pool.cc -o build/temp.macosx-10.9-x86_64-3.6/util/pool.o -O3 -DNDEBUG -DKENLM_MAX_ORDER=6 -std=c++11
In file included from util/pool.cc:1:
In file included from ./util/pool.hh:4:
/Users/adamg/anaconda3/envs/lm_1b/include/c++/v1/cassert:21:10: fatal error: 'assert.h' file not found
#include <assert.h>
^~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/Users/adamg/anaconda3/envs/lm_1b/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/2l/hd8b8vx566ld71lfd8hjglbc0000gn/T/pip-req-build-bkyn5o51/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/2l/hd8b8vx566ld71lfd8hjglbc0000gn/T/pip-record-74c181ep/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/2l/hd8b8vx566ld71lfd8hjglbc0000gn/T/pip-req-build-bkyn5o51/