Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41786 > unrolled thread

ImportError: No module named multipli

Started byyahya Kacem <fuj.tyoli@gmail.com>
First post2013-03-24 08:35 -0700
Last post2013-03-24 16:12 -0700
Articles 9 — 4 participants

Back to article view | Back to comp.lang.python


Contents

  ImportError: No module named multipli yahya Kacem <fuj.tyoli@gmail.com> - 2013-03-24 08:35 -0700
    Re: ImportError: No module named multipli Kwpolska <kwpolska@gmail.com> - 2013-03-24 16:46 +0100
    Re: ImportError: No module named multipli Chris Angelico <rosuav@gmail.com> - 2013-03-25 02:48 +1100
    Re: ImportError: No module named multipli yahya Kacem <fuj.tyoli@gmail.com> - 2013-03-24 09:03 -0700
      Re: ImportError: No module named multipli Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-03-24 16:19 +0000
    Re: ImportError: No module named multipli Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-03-24 16:10 +0000
    Re: ImportError: No module named multipli Chris Angelico <rosuav@gmail.com> - 2013-03-25 03:15 +1100
    Re: ImportError: No module named multipli yahya Kacem <fuj.tyoli@gmail.com> - 2013-03-24 16:06 -0700
    Re: ImportError: No module named multipli yahya Kacem <fuj.tyoli@gmail.com> - 2013-03-24 16:12 -0700

#41786 — ImportError: No module named multipli

Fromyahya Kacem <fuj.tyoli@gmail.com>
Date2013-03-24 08:35 -0700
SubjectImportError: No module named multipli
Message-ID<2c7cb491-62d7-43f6-a1fd-ea8ea8833cda@googlegroups.com>
Hi, i have this 2 files:

file named multipli:

    #!/usr/bin/python3.2
    #-* - coding : utf-8 -*
    def table(nb, max):
      i = 0
      while i < max:
        print(i + 1, " * ", nb, "= ", (i + 1) * nb)

and file naled test:

    #!/usr/bin/python3.2
    # -* - coding : utf-8 -*
    import os
    import sys
    from multipli import table
    table(3, 20)
    os.system("pause")

when i run this:

    python3 test

I get this error:
    Traceback (most recent call last):
      File "test", line 5, in <module>
        from multipli import table
    ImportError: No module named multipli 
both files are in the same directory.
any help thanks in advance.

[toc] | [next] | [standalone]


#41787

FromKwpolska <kwpolska@gmail.com>
Date2013-03-24 16:46 +0100
Message-ID<mailman.3671.1364140014.2939.python-list@python.org>
In reply to#41786
On Sun, Mar 24, 2013 at 4:35 PM, yahya Kacem <fuj.tyoli@gmail.com> wrote:
> Hi, i have this 2 files:
>
> file named multipli:
>
>     #!/usr/bin/python3.2
>     #-* - coding : utf-8 -*
>     def table(nb, max):
>       i = 0
>       while i < max:
>         print(i + 1, " * ", nb, "= ", (i + 1) * nb)
>
> and file naled test:
>
>     #!/usr/bin/python3.2
>     # -* - coding : utf-8 -*
>     import os
>     import sys
>     from multipli import table
>     table(3, 20)
>     os.system("pause")
>
> when i run this:
>
>     python3 test
>
> I get this error:
>     Traceback (most recent call last):
>       File "test", line 5, in <module>
>         from multipli import table
>     ImportError: No module named multipli
> both files are in the same directory.
> any help thanks in advance.
> --
> http://mail.python.org/mailman/listinfo/python-list

make them test.py and multipli.py.

-- 
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail                | always bottom-post
http://asciiribbon.org        | http://caliburn.nl/topposting.html

[toc] | [prev] | [next] | [standalone]


#41788

FromChris Angelico <rosuav@gmail.com>
Date2013-03-25 02:48 +1100
Message-ID<mailman.3672.1364140124.2939.python-list@python.org>
In reply to#41786
On Mon, Mar 25, 2013 at 2:35 AM, yahya Kacem <fuj.tyoli@gmail.com> wrote:
> file named multipli:
>
> and file naled test:
>
>     from multipli import table

Try naming it multipli.py

ChrisA

[toc] | [prev] | [next] | [standalone]


#41790

Fromyahya Kacem <fuj.tyoli@gmail.com>
Date2013-03-24 09:03 -0700
Message-ID<5b53566a-b924-4b13-9cb6-08105e97db0d@googlegroups.com>
In reply to#41786
On Sunday, March 24, 2013 4:35:29 PM UTC+1, yahya Kacem wrote:
> Hi, i have this 2 files:
> 
> 
> 
> file named multipli:
> 
> 
> 
>     #!/usr/bin/python3.2
> 
>     #-* - coding : utf-8 -*
> 
>     def table(nb, max):
> 
>       i = 0
> 
>       while i < max:
> 
>         print(i + 1, " * ", nb, "= ", (i + 1) * nb)
> 
> 
> 
> and file naled test:
> 
> 
> 
>     #!/usr/bin/python3.2
> 
>     # -* - coding : utf-8 -*
> 
>     import os
> 
>     import sys
> 
>     from multipli import table
> 
>     table(3, 20)
> 
>     os.system("pause")
> 
> 
> 
> when i run this:
> 
> 
> 
>     python3 test
> 
> 
> 
> I get this error:
> 
>     Traceback (most recent call last):
> 
>       File "test", line 5, in <module>
> 
>         from multipli import table
> 
>     ImportError: No module named multipli 
> 
> both files are in the same directory.
> 
> any help thanks in advance.

Thanks that did it.

[toc] | [prev] | [next] | [standalone]


#41794

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2013-03-24 16:19 +0000
Message-ID<mailman.3676.1364141984.2939.python-list@python.org>
In reply to#41790
On 24/03/2013 16:03, yahya Kacem wrote:
> On Sunday, March 24, 2013 4:35:29 PM UTC+1, yahya Kacem wrote:
>> Hi, i have this 2 files:
>>
>>
>>
>> file named multipli:
>>
>>
>>
>>      #!/usr/bin/python3.2
>>
>>      #-* - coding : utf-8 -*
>>
>>      def table(nb, max):
>>
>>        i = 0
>>
>>        while i < max:
>>
>>          print(i + 1, " * ", nb, "= ", (i + 1) * nb)
>>
>>
>>
>> and file naled test:
>>
>>
>>
>>      #!/usr/bin/python3.2
>>
>>      # -* - coding : utf-8 -*
>>
>>      import os
>>
>>      import sys
>>
>>      from multipli import table
>>
>>      table(3, 20)
>>
>>      os.system("pause")
>>
>>
>>
>> when i run this:
>>
>>
>>
>>      python3 test
>>
>>
>>
>> I get this error:
>>
>>      Traceback (most recent call last):
>>
>>        File "test", line 5, in <module>
>>
>>          from multipli import table
>>
>>      ImportError: No module named multipli
>>
>> both files are in the same directory.
>>
>> any help thanks in advance.
>
> Thanks that did it.
>

May I ask what did it?

Please read this as it helps prevent the bill from my optician soaring 
http://wiki.python.org/moin/GoogleGroupsPython

-- 
Cheers.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#41791

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2013-03-24 16:10 +0000
Message-ID<mailman.3673.1364141382.2939.python-list@python.org>
In reply to#41786
On 24/03/2013 15:48, Chris Angelico wrote:
> On Mon, Mar 25, 2013 at 2:35 AM, yahya Kacem <fuj.tyoli@gmail.com> wrote:
>> file named multipli:
>>
>> and file naled test:
>>
>>      from multipli import table
>
> Try naming it multipli.py
>
> ChrisA
>

Before or after fixing the infinite loop? :)

-- 
Cheers.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#41793

FromChris Angelico <rosuav@gmail.com>
Date2013-03-25 03:15 +1100
Message-ID<mailman.3675.1364141731.2939.python-list@python.org>
In reply to#41786
On Mon, Mar 25, 2013 at 3:10 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> On 24/03/2013 15:48, Chris Angelico wrote:
>>
>> On Mon, Mar 25, 2013 at 2:35 AM, yahya Kacem <fuj.tyoli@gmail.com> wrote:
>>>
>>> file named multipli:
>>>
>>> and file naled test:
>>>
>>>      from multipli import table
>>
>>
>> Try naming it multipli.py
>>
>> ChrisA
>>
>
> Before or after fixing the infinite loop? :)

Before. Then you run it, see it spew text to the console, and hit Ctrl-C.

Programming is iterative: once you fix one problem, you find the next.
Programming is also recursive: in fixing one problem, you sometimes
have to deal with others that it depends on. Programming is
functional, too: you take a list of problems, apply the "Code"
function to them, and keep the list of return values, which will be
hopefully-working code. And programming is object-oriented... whatever
you do, someone will object to it.

ChrisA

[toc] | [prev] | [next] | [standalone]


#41803

Fromyahya Kacem <fuj.tyoli@gmail.com>
Date2013-03-24 16:06 -0700
Message-ID<ec2ca4fa-d8e0-4d7b-a0ea-a9474cb08bc8@googlegroups.com>
In reply to#41786
On Sunday, March 24, 2013 4:35:29 PM UTC+1, yahya Kacem wrote:
> Hi, i have this 2 files:
> 
> 
> 
> file named multipli:
> 
> 
> 
>     #!/usr/bin/python3.2
> 
>     #-* - coding : utf-8 -*
> 
>     def table(nb, max):
> 
>       i = 0
> 
>       while i < max:
> 
>         print(i + 1, " * ", nb, "= ", (i + 1) * nb)
> 
> 
> 
> and file naled test:
> 
> 
> 
>     #!/usr/bin/python3.2
> 
>     # -* - coding : utf-8 -*
> 
>     import os
> 
>     import sys
> 
>     from multipli import table
> 
>     table(3, 20)
> 
>     os.system("pause")
> 
> 
> 
> when i run this:
> 
> 
> 
>     python3 test
> 
> 
> 
> I get this error:
> 
>     Traceback (most recent call last):
> 
>       File "test", line 5, in <module>
> 
>         from multipli import table
> 
>     ImportError: No module named multipli 
> 
> both files are in the same directory.
> 
> any help thanks in advance.

Hi, after fixing the infinite loop, there was a missing line in my first post inside the while loop I accidentally  deleted this line:
    i += 1;
Sorry for that.
adding the .py to the file name (the one to import) did fix the problem, thanks for the help.

[toc] | [prev] | [next] | [standalone]


#41804

Fromyahya Kacem <fuj.tyoli@gmail.com>
Date2013-03-24 16:12 -0700
Message-ID<3ee2e134-ce86-4950-9fbd-7c81e5023c1c@googlegroups.com>
In reply to#41786
+Mark Lawrence sorry for that I'm new here and I didn't know about that.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web