在IPython Notebook中安装fuzzywuzzy时出错

时间:2014-10-11 17:59:07

标签: python install ipython ipython-notebook fuzzywuzzy

我真的不知道如何使用代码安装库。我试图用模块pip在IPython Notebook中插入fuzzywuzzy但是我收到一条错误消息:

In [45]:

import pip

$ pip install fuzzywuzzy==0.3.1

  File "<ipython-input-45-579762da5e80>", line 3
    $ pip install fuzzywuzzy==0.3.1
    ^
SyntaxError: invalid syntax

那么,如何使用代码正确安装fuzzywuzzy和其他包?

1 个答案:

答案 0 :(得分:1)

pip install fuzzywuzzy==0.3.1 应该从Ipython运行,它应该从bash或您的等效shell运行。它是一个python命令

In [18]: pip install fuzzywuzzy==0.3.1
  File "<ipython-input-18-cf3b3a7fb3ae>", line 1
    pip install fuzzywuzzy==0.3.1
              ^
SyntaxError: invalid syntax

来自bash:

~$ pip install fuzzywuzzy==0.3.1
Downloading/unpacking fuzzywuzzy==0.3