簡體   English   中英

為Python安裝Willie irc bot時出錯

[英]Error installing Willie irc bot for Python

嘗試安裝名為Willie的Python IRC機器人。 這是我運行setup.py時發生的情況:

C:\Python34\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.1\helpers\pycharm\pycharm_setup_runner.py" C:\Users\Quibbles\Documents\willie-5.3.0\setup.py
Testing started at 1:35 PM ...
running pycharm_test
Searching for pygeoip
Best match: pygeoip 0.3.2
Processing pygeoip-0.3.2-py3.4.egg

Using c:\users\quibbles\documents\willie-5.3.0\.eggs\pygeoip-0.3.2-py3.4.egg
Searching for pyenchant
Best match: pyenchant 1.6.6
Processing pyenchant-1.6.6-py3.4-win32.egg

Using c:\users\quibbles\documents\willie-5.3.0\.eggs\pyenchant-1.6.6-py3.4-win32.egg
Searching for praw
Best match: praw 2.1.21
Processing praw-2.1.21-py3.4.egg

Using c:\users\quibbles\documents\willie-5.3.0\.eggs\praw-2.1.21-py3.4.egg
Searching for lxml
Reading https://pypi.python.org/simple/lxml/
Best match: lxml 3.4.4
Downloading https://pypi.python.org/packages/source/l/lxml/lxml-3.4.4.tar.gz#md5=a9a65972afc173ec7a39c585f4eea69c
Processing lxml-3.4.4.tar.gz
Writing C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\setup.cfg
Running lxml-3.4.4\setup.py -q bdist_egg --dist-dir C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\egg-dist-tmp-0expfysa
Building lxml version 3.4.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 
C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
  warnings.warn(msg)
cl : Command line warning D9025 : overriding '/W3' with '/w'
lxml.etree.c
C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
error: Setup script exited with error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

Process finished with exit code 1

我究竟做錯了什么? 我從https://github.com/embolalia/willie/releases/tag/v5.3.0下載了源代碼,並嘗試在PyCharm中運行setup.py。

通過錯誤消息應該很明顯:

**確保已安裝libxml2和libxslt的開發包**

您需要安裝dev libxml2和libxslt。 似乎您的版本可能不正確,或者安裝不正確。

I'L'I的答案可以提示您下一步從哪里開始搜索,但這不是有用的答案。

經過幾次嘗試,我發現要安裝lxml庫,我需要執行以下操作:

首先,從http://www.lfd.uci.edu/~gohlke/pythonlibs/下載lxml庫

這是必需的,因為PiPy存檔( https://pypi.python.org/pypi/lxml/3.4.4 )已過時,只為您提供了為3+系列的Python 3.2安裝的選項。如果您使用3.4,則課程毫無用處。 如果您使用的是64位,則還會出現問題。 但是,如果您使用的是2.7,它們可能就足夠了。

然后按照此處的說明進行操作: 如何安裝帶有.whl文件的Python軟件包? 安裝.whl文件。

但是,這只能解決一半的問題。 由於試圖引用類unix的/ tmp目錄(絕對路徑)而不是正確的Windows Temp目錄,willie軟件包似乎以其他方式被破壞(在Windows上)。

盡管尚未修復,但此問題描述了問題: https : //github.com/embolalia/willie/issues/811

它表明它是安裝程序中特定於Windows的錯誤。 要解決此問題 ,請從https://pypi.python.org/pypi/willie/5.3.0下載.tar.gz

打開包裝。 轉到willie-5.3.0 \\ willie.egg-info目錄,然后編輯SOURCES.txt文件。 第五行是/tmp/tmpeAhjCF/willie 刪除該行。

將目錄重新打包到.tar.gz存檔中。 通過pip install .\\willie-5.3.0.tar.gz

現在已經安裝好了,您已經准備好迎接下一輪實際運行在Windows上的問題。 由於我實際上尚未成功完成此操作,因此,這是我目前所能提供的最大幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM