怎么在Anaconda 2.7下import jieba
我现在在Anaconda 2.7里想要import jieba,但是一直不成功,给我这个提示:
import jieba
Traceback (most recent call last):
File "<ipython-input-211-533d403cdb1f>", line 1, in <module>
import jieba
ImportError: No module named jieba
我已经在terminal里输了 pip install jieba
给我的显示是:
Users-MacBook-Air-5:~ user$ pip install jieba
Requirement already satisfied: jieba in /anaconda/lib/python2.7/site-packages/jieba-0.38-py2.7.egg
不知道这样算不是已经安装好了?但是就是没有办法import
后来看到一个帖子,我试了这个方法:
Users-MacBook-Air-5:~ user$ conda install jieba
Fetching package metadata .........
PackageNotFoundError: Package missing in current osx-64 channels:
jieba
Users-MacBook-Air-5:~ user$ anaconda search -t conda jieba
Using Anaconda API: https://api.anaconda.org
Run 'anaconda show <USER/PACKAGE>' to get more details:
Packages:
Name | Version | Package Types | Platforms
------------------------- | ------ | --------------- | ---------------
auto/jieba | 0.32 | conda | linux-64, linux-32
: http://github.com/fxsjy
conda-forge/jieba | 0.38 | conda | linux-64, win-32, win-64, osx-64
creditx/jieba | 0.38 | conda | linux-64
hargup/jieba | | conda | linux-64
: Chinese Words Segementation Utilities
iilab/jieba | 0.36.2 | conda | linux-64, osx-64
: Chinese Words Segementation Utilities
iilab/jieba3k | 0.35.1 | conda | linux-64, osx-64
: Chinese Words Segementation Utilities
jiangxiluning/jieba | 0.36.2 | conda | linux-64, osx-64, win-64
: Chinese Words Segementation Utilities
moustik/jieba | 0.38 | conda | linux-64
Found 8 packages
Users-MacBook-Air-5:~ user$ conda install -c https://conda.anaconda.org/iilab jieba
Fetching package metadata ...........
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
jieba -> python 3.4*
python 2.7*
Use "conda info <package>" to see the dependencies for each package.
Users-MacBook-Air-5:~ user$ conda install -c https://conda.anaconda.org/iilab jieba3k
Fetching package metadata ...........
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
jieba3k -> python 3.4*
python 2.7*
Use "conda info <package>" to see the dependencies for each package.
那最后这个unsatisfiableErrors是什么问题呢
我是小白,求各位大神carry一下!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
unsatisfiableErrors就是运行环境不对的意思,这个包需要python3.4的吧。
你电脑里的有多环境python,默认pip与python不是一个环境的。导致PIP安装的东西不在默认python的库里。配置一下环境变量。