2016-11-23 3 views
2

저는 Python 버전 3.5.2를 사용하고 있습니다.vcvarsall.bat 오류를 찾을 수 없습니다.

MSWord 문서에서 단어와 단락을 편집하려고합니다.

내가 할 수 있기 전에 docx 모듈을 설치해야합니다.

C:\Users\d\AppData\Local\Programs\Python\Python35-32\Scripts 

를 입력 : 명령 줄에서

내가 경로로 지적

"unable to find vcvarsall.bat". 
: 수익을 타격 한 후

pip install python-docx. 

,이 오류 메시지 (아래 전체 출력)을 얻을

어떻게이 오류를 해결할 수 있습니까?


c:\Users\D\AppData\Local\Programs\Python\Python35-32\Scripts>pip install 
python-docx 
Collecting python-docx 
    Using cached python-docx-0.8.6.tar.gz 
Collecting lxml>=2.3.2 (from python-docx) 
    Using cached lxml-3.6.4.tar.gz 
Installing collected packages: lxml, python-docx 
    Running setup.py install for lxml ... error 
    Complete output from command c:\users\d\appdata\local\programs\python 
\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ 
D\\AppData\\Local\\Temp\\pip-build-9yk1nedc\\lxml\\setup.py';f=getattr(to 
kenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();ex 
ec(compile(code, __file__, 'exec'))" install --record C:\Users\D\AppData\ 
Local\Temp\pip-pepj9c3f-record\install-record.txt --single-version-externally-ma 
naged --compile: 
    Building lxml version 3.6.4. 
    Building without Cython. 
    ERROR: b"'xslt-config' is not recognized as an internal or external command, 
\r\noperable program or batch file.\r\n" 
    ** make sure the development packages of libxml2 and libxslt are installed * 
* 
    Using build configuration of libxslt 
    running install 
    running build 
    running build_py 
    creating build 
    creating build\lib.win32-3.5 
    creating build\lib.win32-3.5\lxml 
    copying src\lxml\builder.py -> build\lib.win32-3.5\lxml 
    copying src\lxml\cssselect.py -> build\lib.win32-3.5\lxml 
    copying src\lxml\doctestcompare.py -> build\lib.win32-3.5\lxml 
    copying src\lxml\ElementInclude.py -> build\lib.win32-3.5\lxml 
    copying src\lxml\pyclasslookup.py -> build\lib.win32-3.5\lxml 
    copying src\lxml\sax.py -> build\lib.win32-3.5\lxml 
    copying src\lxml\usedoctest.py -> build\lib.win32-3.5\lxml 
    copying src\lxml\_elementpath.py -> build\lib.win32-3.5\lxml 
    copying src\lxml\__init__.py -> build\lib.win32-3.5\lxml 
    creating build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\__init__.py -> build\lib.win32-3.5\lxml\includes 
    creating build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\builder.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\clean.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\defs.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\diff.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\ElementSoup.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\formfill.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\html5parser.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\soupparser.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\usedoctest.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\_diffcommand.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\_html5builder.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\_setmixin.py -> build\lib.win32-3.5\lxml\html 
    copying src\lxml\html\__init__.py -> build\lib.win32-3.5\lxml\html 
    creating build\lib.win32-3.5\lxml\isoschematron 
    copying src\lxml\isoschematron\__init__.py -> build\lib.win32-3.5\lxml\isosc 
hematron 
    copying src\lxml\lxml.etree.h -> build\lib.win32-3.5\lxml 
    copying src\lxml\lxml.etree_api.h -> build\lib.win32-3.5\lxml 
    copying src\lxml\includes\c14n.pxd -> build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\config.pxd -> build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\dtdvalid.pxd -> build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\etreepublic.pxd -> build\lib.win32-3.5\lxml\includ 
es 
    copying src\lxml\includes\htmlparser.pxd -> build\lib.win32-3.5\lxml\include 
s 
    copying src\lxml\includes\relaxng.pxd -> build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\schematron.pxd -> build\lib.win32-3.5\lxml\include 
s 
    copying src\lxml\includes\tree.pxd -> build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\uri.pxd -> build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\xinclude.pxd -> build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\xmlerror.pxd -> build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\xmlparser.pxd -> build\lib.win32-3.5\lxml\includes 

    copying src\lxml\includes\xmlschema.pxd -> build\lib.win32-3.5\lxml\includes 

    copying src\lxml\includes\xpath.pxd -> build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\xslt.pxd -> build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\etree_defs.h -> build\lib.win32-3.5\lxml\includes 
    copying src\lxml\includes\lxml-version.h -> build\lib.win32-3.5\lxml\include 
s 
    creating build\lib.win32-3.5\lxml\isoschematron\resources 
    creating build\lib.win32-3.5\lxml\isoschematron\resources\rng 
    copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib 
.win32-3.5\lxml\isoschematron\resources\rng 
    creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl 
    copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win 
32-3.5\lxml\isoschematron\resources\xsl 
    copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win 
32-3.5\lxml\isoschematron\resources\xsl 
    creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron 
-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstra 
ct_expand.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schema 
tron-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_i 
nclude.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematro 
n-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schema 
tron_message.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-sch 
ematron-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schema 
tron_skeleton_for_xslt1.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\ 
xsl\iso-schematron-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_f 
or_xslt1.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schemat 
ron-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt 
-> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
    running build_ext 
    building 'lxml.etree' extension 
    error: Unable to find vcvarsall.bat 
    ---------------------------------------- 
Command "c:\users\d\appdata\local\programs\python\python35-32\python.exe 
-u -c "import setuptools, tokenize;__file__='C:\\Users\\D\\AppData\\Local 
\\Temp\\pip-build-9yk1nedc\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__ 
file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file_ 
_, 'exec'))" install --record C:\Users\D\AppData\Local\Temp\pip-pepj9c3f- 
record\install-record.txt --single-version-externally-managed --compile" failed 
with error code 1 in C:\Users\D\AppData\Local\Temp\pip-build-9yk1nedc\lxm 
l\ 
+0

, pip 예컨대을 사용하여 설치합니다. 'python-docx windows lxml install'에 대한 빠른 검색은 http://stackoverflow.com/questions/27589971/unable-to-install-python-docx와 같은 다른 질문을 포함하여 필요한 모든 것을 제공합니다. – scanny

+0

의견을 보내 주셔서 감사합니다. 그래서 파이썬 -docx를 설치하기 전에 lxml을 설치해야하지만, lxml을 사용해야하고 어떻게 설치해야합니까? Thanks lxml 링크는 다음과 같습니다. http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml – Johnseito

답변

1

이 는 Windows의 LXML 파이썬 라이브러리를 설치하기로 잘 알려진 문제입니다.

여기서 TL, DR 버전은 사전 컴파일 된 "바이너리 설치 패키지"에서 lxml을 설치하고 모든 세부 사항을 처리합니다.

당신은 여기에 그 중 하나를 찾을 수 있습니다 및 버전 (예를 들면, PyPy는 달리 일반 파이썬), 그래서 'CP'세그먼트 'C 파이썬'을 의미 http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml

당신이 사용하는 경우 파이썬 2.7 당신은 이름에 -cp27-와 패키지 중 하나를 원한다. 이 중 두 가지가 있습니다. 하나는 32 비트 용이고 다른 하나는 64 비트 용입니다. that's the default Python install on Windows이기 때문에 아마 32 비트를 원할 것입니다.

당신이 바이너리 설치 패키지 ("바퀴")을 다운로드 한 후에는이 Windows에서`파이썬 lxml` 라이브러리를 설치하기로 잘 알려진 문제 :

pip install lxml‑3.6.4‑cp27‑cp27m‑win32.whl 
+0

저는 파이썬으로 시작했습니다. Python 버전 ** 3.5.2 ** 및 Window 7 운영 체제 ** 64 비트 **를 사용하고 있습니다. 그래서 내가 사용하는 것에 따라'lxml-3.6.4-cp35-cp35m-win_amd64.whl'을 다운로드하고이 파일을 C : \ Users \ d \ AppData \ Local \ Programs \ Python \ Python35-32의 Scripts 디렉토리에 추가했습니다. \ Scripts 그런 다음 그 폴더를 가리키는 명령 프롬프트에서'pip install lxml-3.6.4-cp35-cp35m-win_amd64.whl'을 입력하면 오류 메시지가 나타납니다 : ** _ lxml-3.6.4-cp35-cp35m-win_amd64.whl 이 플랫폼에서 지원되는 휠이 아닙니다. ** – Johnseito

+0

@ 존세이토 내가 당신을 도울 수 있다고 생각하지 않습니다. 변수가 너무 많습니다. .whl 파일을 바탕 화면이나 문서 폴더와 같이 다른 곳으로 이동하는 것으로 시작합니다. 특별한 장소에 있어야 할 필요는 없으며 현재 "특별한"폴더가 문제의 일부인지 여부를 말하는 것이 어렵습니다. 그렇다면 나는'pip'가 사용하는 파이썬이 3.5.2 설치가 아니라고 생각합니다. 당신은 하나의 머신 상에 여러 개의 Python 설치를 가질 수 있습니다. 내가 생각할 수있는 또 다른 일은 pip 버전이 너무 오래되었을 수도 있고,'pip --version'을 시도해보고 적어도 버전 8이 아니라면 업그레이드하십시오. – scanny

+0

정상적으로 Python 3.5를 설치했을 때.2 pip 버전 8.1.1이 나온 다음 9.0.1로 업그레이드 할 수 있습니다. 모두 핍 버전 및 아무리 파일을 넣어도 같은 오류 메시지가 나타납니다. 나는 그 오류 메시지를 구글에 넣고 그것에 대한 연구를 할 것이다. – Johnseito