Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 2nd, 2004, 03:00 PM
DevHims DevHims is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 27 DevHims User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Py2Exe problem??? Could not find User defined Module and generate Error.

Helloooooo to all,

I am really new to python and also to py2exe. I have been working with python since few days. I am trying to create stream.exe file from stream.py file. I am doing this from last three weeks. This is second post for same problem.

Stream.py file imports module using this syntex
"from libflow import *"
and use functions which are defined in libflow module.

When i used py2exe to create stream.exe ,it creates streams .exe file but atlast gives error message that

'[libflow]' unable to locate this module.

When i used stream.exe it is not working properly.

My setup script, stream.py file and all other necessary files are in same folder.


What i shoud use to make stream.exe working properly?

My setup.py file is

from distutils.core import setup
import py2exe
setup(console=["stream.py"])


Please anybody can send me some referencce or solution example for my problem. Please.............

Thanks in advance.

DevHims

Reply With Quote
  #2  
Old June 2nd, 2004, 10:23 PM
xlordt's Avatar
xlordt xlordt is offline
Only the strong survives!!.
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Feb 2003
Location: A World of wonders.
Posts: 5,547 xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 1 h 43 m 50 sec
Reputation Power: 378
Send a message via ICQ to xlordt Send a message via AIM to xlordt Send a message via MSN to xlordt Send a message via Yahoo to xlordt Send a message via Google Talk to xlordt Send a message via Skype to xlordt
Facebook MySpace
1: Check and make sure that the module is on the right path
2: What version of py2exe, and python do you have?

I hade sorta errors like this.. the location to the modules was incorrect.. so i decided to reinstall everything.. starting from 2.3.2 then whent up to 2.3.4 installed py2exe and never got another error while wrapping my programs in to executable files

Also running your program out of the python directory on windows.. can sometimes cause this error as well ( weird but its true )

Reply With Quote
  #3  
Old June 3rd, 2004, 03:13 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 7
Send a message via MSN to Grim Archon
Did the program run without using py2exe?

Where did you install the libflow module? It is not part of the standard distribution.

Grim
__________________
*** Experimental Python Markup CGI V2 ***

Reply With Quote
  #4  
Old June 3rd, 2004, 09:24 AM
DevHims DevHims is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 27 DevHims User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs down

Hey xlodrt,

I am using py2exe 0.5.0 and python 2.3. I checked path using "Sys.path" . All paths are listed there. And my Module also in one the directory from that list. So, i guess it should work. What do u think?

@ Grim,

Program is working fine. The module "libflow" is developed by me. It is not standard module come with python. Scripts which uses this module,it is working fine. But when i tried to convert one my script into .exe which uses this module, it
gives error.

I think i will try with python 2.3.4 now. Hopefully it will work. But please provide me your inputs, if you find any soultion.

Thanks Buddys.

DevHims

Reply With Quote
  #5  
Old June 3rd, 2004, 12:55 PM
xlordt's Avatar
xlordt xlordt is offline
Only the strong survives!!.
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Feb 2003
Location: A World of wonders.
Posts: 5,547 xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 1 h 43 m 50 sec
Reputation Power: 378
Send a message via ICQ to xlordt Send a message via AIM to xlordt Send a message via MSN to xlordt Send a message via Yahoo to xlordt Send a message via Google Talk to xlordt Send a message via Skype to xlordt
Facebook MySpace
Usualy when you create a python module you put it inside site-package, have you tried that? ( i mean the module itself ) i know you can add a directory with your module inside.. but i dont know how to do that part yet

Reply With Quote
  #6  
Old June 4th, 2004, 05:18 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 7
Send a message via MSN to Grim Archon
To create directories or "packages" is very easy like this:

1. Create a sub-directory called "mypackage".
2. Create a file in that directory called __init__.py (it can be empty but you could put a comment in it.)
3. Put your files in that directory e.g. file1.py, file2.py

This sub-directory can be placed in the working directory for the application or somewhere (site-packages) in the $PYTHONPATH.

when you want to import file1 or file 2 you use:

import mypackage.file1
import mypackage.file2

The important thing is to always have the __init__.py file. This tells python that the subdirectory is valid for searching.
__init__.py is also a real python module and is executed automatically (a bit like a class __init__ method ). There are a number of useful things you can do with __init__.py so it worth reading up on.

grim

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Py2Exe problem??? Could not find User defined Module and generate Error.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT