1

I need to import the constants library but it is not working...

import spacy
import pandas
import textacy
import pandas as pd
from pandas import Series
from . import constants

Erreur:

ImportError                               Traceback (most recent call last)
<ipython-input-49-df52595371dd> in <module>()
  4 import pandas as pd
  5 from pandas import Series
----> 6 from . import constants

ImportError: cannot import name 'constants'

I am using anaconda 3 on windows 10 and tried to install this library with the conda:

conda install -c auto constants

But it still does not work...

marin
  • 923
  • 2
  • 18
  • 26

2 Answers2

3
from . import constants

imports a python file called constants inside your current directory.

I doubt you installed it in your directory?

so just do import constants

. means look in current directory I believe

Alexis Drakopoulos
  • 1,115
  • 7
  • 22
0

Using from shouldn't be necessary in the last line. Simply type:

import constants

that should do the trick.