ModuleNotFoundError - 在Mac上的Jupyter笔记本导入faker

时间:2018-03-22 15:22:40

标签: jupyter faker

我正试图从mac上的jupyter笔记本导入faker并失败。

抱怨如下:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-6235527da291> in <module>()
----> 1 from faker import Faker

ModuleNotFoundError: No module named 'faker'

我使用pip install faker并且系统说

Requirement already satisfied: faker in /Applications/anaconda3/lib/python3.6/site-packages
Requirement already satisfied: text-unidecode in /Applications/anaconda3/lib/python3.6/site-packages (from faker)
Requirement already satisfied: python-dateutil>=2.4 in /Applications/anaconda3/lib/python3.6/site-packages (from faker)
Requirement already satisfied: six in /Applications/anaconda3/lib/python3.6/site-packages (from faker)

如果有人能帮助我,我将不胜感激

由于

2 个答案:

答案 0 :(得分:0)

  • 解决方案1:您正在使用python3.6,因此请尝试使用pip3代替pip
  • 解决方案2:使用this tuto
  • 中提到的python3虚拟环境
  • 解决方案3:这是here的另一个想法:使用python -m pip install <package>而不是pip install <package>

答案 1 :(得分:0)

由于您使用的是Python python3.6,因此请使用pip3 install Faker而不是pip install Faker