Re: python package confusion

Discussion in 'Python' started by Devin Jeanpierre, Jul 23, 2012.

  1. On Mon, Jul 23, 2012 at 6:02 AM, Lipska the Kat <> wrote:
    > The PYTHONPATH ev is set to /home/lipska/python/dev/mods:.
    > in .bashrc


    Did you export it? Show us your .bashrc, or the relevant line in it
    exactly. (And make sure that it isn't defined multiple times).

    Also adding . to the import search path is probably a bad diea.

    > lipska@ubuntu:~/python/dev/mods$ test.py
    > Traceback (most recent call last):
    > File "./test.py", line 5, in <module>
    > fib(1000)
    > NameError: name 'fib' is not defined


    Neither of the files you described in your email message contain the
    line "fib(1000)", so you pasted the wrong files.

    > I also have an empty file __init__.py in the mods directory


    This only matters if you want to "import mods".

    -- Devin
     
    Devin Jeanpierre, Jul 23, 2012
    #1
    1. Advertising

  2. Devin Jeanpierre

    David Guest

    On 23/07/2012, Lipska the Kat <> wrote:

    > Hello again pythoners

    [snip]
    > Any help much appreciated.


    Hi Lipska

    Glad you got it sorted.

    In case you are not aware of this:
    Tutor maillist -
    http://mail.python.org/mailman/listinfo/tutor

    The tutor list caters specifically for requests for basic assistance
    such as you made in this thread, and code review such as in your
    thread prior. It too is a busy list, and many of the people who have
    responded to your previous threads here are also present there, so
    you'll get the same high quality answers there too.

    By the way, I had a followup to my previous message to you re git, and
    emailed it to you directly because it would be off-topic here, but the
    email bounced. It seems that you are displaying an invalid email
    address, at least here I get:
    $ ping lipskathekat.com
    ping: unknown host lipskathekat.com
    So if you are interested in that, feel free to email me directly, or
    not as you wish.
     
    David, Jul 23, 2012
    #2
    1. Advertising

  3. On Mon, 23 Jul 2012 06:22:45 -0400, Devin Jeanpierre wrote:

    > Also adding . to the import search path is probably a bad diea.



    I don't know about a bad idea or not, but it is certainly redundant,
    because Python automatically adds '' (equivalent to '.') to the very
    start of the search path.


    --
    Steven
     
    Steven D'Aprano, Jul 24, 2012
    #3
  4. On Tue, Jul 24, 2012 at 1:38 AM, Steven D'Aprano
    <> wrote:
    > I don't know about a bad idea or not, but it is certainly redundant,
    > because Python automatically adds '' (equivalent to '.') to the very
    > start of the search path.


    No, it only does that if Python is reading commands from stdin, or if
    Python was run with the -c option, or maybe some other situations. It
    doesn't do it if you just run a program, as in "python myfile.py".

    -- Devin
     
    Devin Jeanpierre, Jul 24, 2012
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Parvinder
    Replies:
    6
    Views:
    750
    Thomas G. Marshall
    Feb 27, 2005
  2. Jugdish
    Replies:
    3
    Views:
    339
    Scott David Daniels
    Jan 1, 2008
  3. Dale Amon

    import and package confusion

    Dale Amon, Apr 29, 2009, in forum: Python
    Replies:
    29
    Views:
    755
    Dennis Lee Bieber
    May 1, 2009
  4. Klein Stéphane
    Replies:
    3
    Views:
    596
    Steve Holden
    Dec 20, 2009
  5. Dave Angel

    Re: python package confusion

    Dave Angel, Jul 23, 2012, in forum: Python
    Replies:
    0
    Views:
    140
    Dave Angel
    Jul 23, 2012
Loading...

Share This Page