开发者

Unable to import nltk in NetBeans

开发者 https://www.devze.com 2022-12-29 05:35 出处:网络
I am trying to import NLTK in my python code and I get this error: Traceback (most recent call last): File \"/home/afs/NetBeansProjects/NER/getNE_followers.py\", line 7, in <module>

I am trying to import NLTK in my python code and I get this error:

Traceback (most recent call last):
  File "/home/afs/NetBeansProjects/NER/getNE_followers.py", line 7, in <module>
    import nltk
ImportError: No module named nltk
开发者_开发知识库

I am using NetBeans: 6.7.1, Python 2.6 NLTK. My NLTK module is installed in /usr/local/lib/python2.6/dist-packages/nltk/ and I have added this in Python paths in Netbeans.

What am I missing here?

Thanks in advance.


You might have default python installation on /usr/bin/python. So, In Netbeans preference, try to set python interpreter to /usr/local/bin/python instead of /usr/bin/python


Rectified the problem. I had included the nltk path in the Netbeans global settings but the project was still using Jython 2.5 as its Python platform so the global settings never affected the project.

0

精彩评论

暂无评论...
验证码 换一张
取 消