我正在将博客从Wordpress迁移到Octopress。作为此过程的一部分,我使用名为exitwp的工具将所有Wordpress内容转换为Markdown文件。Exitwp无法导入PyYAML模块
我已按照exitwp
安装说明安装了所有要求。 Python使用homebrew安装; Python模块安装了pip
。我在使用OS X 10.9的Mac上。
$ which python
/usr/bin/python
$ pip install --upgrade -r pip_requirements.txt
Requirement already up-to-date: html5lib==1.0b1 in /usr/local/lib/python2.7/site-packages (from -r pip_requirements.txt (line 1))
Requirement already up-to-date: beautifulsoup4==4.2.0 in /usr/local/lib/python2.7/site-packages (from -r pip_requirements.txt (line 2))
Requirement already up-to-date: PyYAML==3.10 in /usr/local/lib/python2.7/site-packages (from -r pip_requirements.txt (line 3))
Requirement already up-to-date: html2text==3.200.3 in /usr/local/lib/python2.7/site-packages (from -r pip_requirements.txt (line 4))
Requirement already up-to-date: six in /usr/local/lib/python2.7/site-packages (from html5lib==1.0b1->-r pip_requirements.txt (line 1))
$ pip show PyYAML
Name: PyYAML
Version: 3.10
Location: /usr/local/lib/python2.7/site-packages
Requires:
$ python -c "import sys; print sys.path"
['', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages']
当我运行exitwp
,我得到以下错误:
$ cd ~/code/exitwp/
$ python exitwp.py
Traceback (most recent call last):
File "exitwp.py", line 10, in <module>
import yaml
ImportError: No module named yaml
我的想法是,这可能是与Python的未来预安装了OS X,而且我已经安装通过homebrew
更新的Python版本。我对Python和pip
并不是很有经验,所以我遇到了一些问题。
如果有人能指出我正确的方向,将不胜感激。
你能运行'蟒蛇-c“进口SYS;打印sys.path的”从'你的命令行并发布输出? – jazzpi
谢谢,@jazzpi。我编辑了我的问题并添加了这些信息。 – Leif
@Leif太棒了!你救了我一天 –