easy_install of module produces un-importable result

Discussion in 'Python' started by Val, Dec 8, 2008.

  1. Val

    Val Guest

    I've written my first module, "gpsparser" and uploaded it as an egg to
    PyPI. I can use easy_istall to install my own module, but when I try
    to import it I get an ImportError "No module named gpsparser".

    So I've done some research and found that in my site-packages/
    directory gpsparser exists as an egg file, while all the other
    packages I've installed exist as an egg directory.

    If this makes any sense, can anyone explain what I've done wrong in
    building my package that the installation process does not unpack the
    egg file?

    Thanks,

    Val
     
    Val, Dec 8, 2008
    #1
    1. Advertising

  2. Val schrieb:
    > I've written my first module, "

    " and uploaded it as an egg to
    > PyPI. I can use easy_istall to install my own module, but when I try
    > to import it I get an ImportError "No module named gpsparser".
    >
    > So I've done some research and found that in my site-packages/
    > directory gpsparser exists as an egg file, while all the other
    > packages I've installed exist as an egg directory.
    >
    > If this makes any sense, can anyone explain what I've done wrong in
    > building my package that the installation process does not unpack the
    > egg file?



    This has nothing to do with that - it's simply that your egg is empty.
    Take a look at this:

    (gpsparser)mac-dir:Application Support deets$ unzip -l
    /Users/deets/.virtualenvs/gpsparser/lib/python2.5/site-packages/gpsparser-0.0.1-py2.5.egg
    Archive:
    /Users/deets/.virtualenvs/gpsparser/lib/python2.5/site-packages/gpsparser-0.0.1-py2.5.egg
    Length Date Time Name
    -------- ---- ---- ----
    1 12-08-08 12:04 EGG-INFO/dependency_links.txt
    249 12-08-08 12:04 EGG-INFO/PKG-INFO
    599 12-08-08 12:04 EGG-INFO/SOURCES.txt
    1 12-08-08 12:04 EGG-INFO/top_level.txt
    1 12-08-08 11:25 EGG-INFO/zip-safe
    -------- -------
    851 5 files
    (gpsparser)mac-dir:Application Support deets$

    I presume you miss a

    packages=find_packages(),

    line in your setup.py, with

    from setuptools import setup, find_packages

    to actually get the find_packages.

    Diez
     
    Diez B. Roggisch, Dec 8, 2008
    #2
    1. Advertising

  3. Val

    Val Guest

    On Dec 8, 2:57 pm, "Diez B. Roggisch" <> wrote:
    > Val schrieb:> I've written my first module, "
    >
    > " and uploaded it as an egg to
    >
    > > PyPI. I can use easy_istall to install my own module, but when I try
    > > to import it I get an ImportError "No module named gpsparser".

    >
    > > So I've done some research and found that in my site-packages/
    > > directory gpsparser exists as an egg file, while all the other
    > > packages I've installed exist as an egg directory.

    >
    > > If this makes any sense, can anyone explain what I've done wrong in
    > > building my package that the installation process does not unpack the
    > > egg file?

    >
    > This has nothing to do with that - it's simply that your egg is empty.
    > Take a look at this:
    >
    > (gpsparser)mac-dir:Application Support deets$ unzip -l
    > /Users/deets/.virtualenvs/gpsparser/lib/python2.5/site-packages/gpsparser-0 .0.1-py2.5.egg
    > Archive:
    > /Users/deets/.virtualenvs/gpsparser/lib/python2.5/site-packages/gpsparser-0 .0.1-py2.5.egg
    >    Length     Date   Time    Name
    >   --------    ----   ----    ----
    >          1  12-08-08 12:04   EGG-INFO/dependency_links.txt
    >        249  12-08-08 12:04   EGG-INFO/PKG-INFO
    >        599  12-08-08 12:04   EGG-INFO/SOURCES.txt
    >          1  12-08-08 12:04   EGG-INFO/top_level.txt
    >          1  12-08-08 11:25   EGG-INFO/zip-safe
    >   --------                   -------
    >        851                   5 files
    > (gpsparser)mac-dir:Application Support deets$
    >
    > I presume you miss a
    >
    >      packages=find_packages(),
    >
    > line in your setup.py, with
    >
    > from setuptools import setup, find_packages
    >
    > to actually get the find_packages.
    >
    > Diez


    You are absolutely right. How embarrassing. Thank you SO much!

    -Val
     
    Val, Dec 8, 2008
    #3
    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. Robert P. J. Day

    how to check if a module is importable?

    Robert P. J. Day, Jan 20, 2010, in forum: Python
    Replies:
    2
    Views:
    256
    Robert P. J. Day
    Jan 20, 2010
  2. Daniel Berger
    Replies:
    3
    Views:
    128
    Daniel Berger
    Oct 30, 2004
  3. Kevin Howe

    Ruby DL::Importable struct issue

    Kevin Howe, Nov 23, 2004, in forum: Ruby
    Replies:
    7
    Views:
    180
    Kevin Howe
    Nov 25, 2004
  4. Michael Tan
    Replies:
    32
    Views:
    1,079
    Ara.T.Howard
    Jul 21, 2005
  5. Terry Reedy

    Building importable _tkinter on Windows

    Terry Reedy, Mar 10, 2013, in forum: Python
    Replies:
    0
    Views:
    171
    Terry Reedy
    Mar 10, 2013
Loading...

Share This Page