Python Forum

Full Version: ImportError: No module named 'pyConTextNLP.pyConText'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I working on a python package called pyConTextNLP. I have issue importing these modules. I'm using python 3.5 and doing all the stuff inside a virtual environment. I'm getting Import error for pyConTextNLP.pyConText and pyConTextNLP.itemData and not for other packages. Any help is appreciated. Thank you!

import pyConTextNLP.pyConText as pyConText
import pyConTextNLP.itemData as itemData
import networkx as nx
ImportError Traceback (most recent call last)
<ipython-input-3-5362fa3a3667> in <module>()
----> 1 import pyConTextNLP.pyConText as pyConText
2 import pyConTextNLP.itemData as itemData
3 import networkx as nx

ImportError: No module named 'pyConTextNLP.pyConText'
How did you install the pyConTextNLP module in your virtual env?
I installed some dependencies and then did

pip install pyConTextNLP
I've just created a Docker Image (ubuntu) with python3 + pip3, then:
pip3 install pyConTextNLP
Installed: pyConTextNLP-0.6.2.0-py2.py3-none-any.whl
Installed: networkx-1.11-py2.py3-none-any.whl
Installed: decorator-4.3.0-py2.py3-none-any.whl
And now I'm able to import pyConTextNLP.
When you installed the pyConTextNLP using pip, you were inside your virtual env, right?

Your error is that you are trying to import pyConTextNLP.pyConText, and it doesn't exist.

Reading the github docs of the module I saw this way to import it, maybe it'll help you:

import pyConTextNLP.pyConTextGraph as pyConText
import pyConTextNLP.itemData as itemData
Yes, I was inside virtualenv. I tried it on my windows laptop and imac and both time I got same error. maybe I'm doing some mistake while installing.
Check my post again, the second part...
It worked!! thanks,
Is that the version github describes and the version that I have installed from python repository different?
I don't think so, if you use pip to install and upgrade you'll be good to go.
Ok. Thanks