python : ImportError: No module named utils with clean_string
<p>Note: I have already check question with same error as mine but mine is different i want to ask if "clean_string, clean_number, clean_text, clean_float, clean_int"</p>

<p><strong><code>agency_id = scrapy.Field(serializer=clean_string)</code></strong></p>

<p>are some in built function in python or i have to import to make it work</p>

<p>I am new in python just doing some programming stuffs.</p>

<p>Below i my code snippet</p>

<pre><code>from .utils import clean_string, clean_number, clean_text, clean_float, clean_int
from six.moves.urllib.parse import urljoin

class MyItem(scrapy.Item):
    # define the fields for your item here like:
    # name = scrapy.Field()
    agency_id = scrapy.Field(serializer=clean_string)
</code></pre>

<p>when i run above code it give me error </p>

<pre><code>**ImportError: No module named utils**
</code></pre>

<p>can you help with it have i to install <strong>clean_string</strong> or something </p>

<p>As per our discussion, please install <code>python -m pip install pyes</code></p>

<p>do it as below:</p>

<pre><code>from pyes import utils

# use it like below
class MyItem(scrapy.Item):
    # define the fields for your item here like:
    # name = scrapy.Field()
    agency_id = scrapy.Field(serializer=utils.clean_string)
</code></pre>

<p>(or)</p>

<pre><code>from pyes.utils import clean_string

# use it like below
class MyItem(scrapy.Item):
    # define the fields for your item here like:
    # name = scrapy.Field()
    agency_id = scrapy.Field(serializer=clean_string)
</code></pre>

<p>you cannot use <code>from .utils import clean_string</code> because it looks for <code>utils</code> in current working directory. Instead either use <code>from django import utils</code> (or) use <code>from pyes.utils import clean_string</code></p>

python