473,837 Members | 1,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Distributing Python Programs

5 New Member

I have written a program that requires some modules from pyxml to run. It will run fine on my pc but if I try to run it on another pc with python but without the pyxml modules, I will get import errors. What is the best way to run my program on other pc's without having to install dependent modules on them?

I have tried cx_freeze, freeze.py and am having issues with those. Is there any other alternatives? I am using python 2.5 and OpenSuse 10.1. Thanks.
Mar 11 '08 #1
6 1549
314 Contributor
You can either try building a distributable program, or literally taking the inherited functions that you use and put the code into your own program...

Why are you trying to do this? If you would like to create distributions (like .exe ) you should look into py2exe
Mar 11 '08 #2
5 New Member
I have tried cx_freeze and freeze.py to create standalone programs but am having issues with those two methods that I am still working on. I cannot use py2exe because I am running linux.
Mar 11 '08 #3
314 Contributor
Oh yeah, sorry.. missed that.

Have you tried this... ?

Mar 11 '08 #4
5 New Member
I'll try to clarify my situation and what I am trying to achieve...
I would like to put my script on a shared directory where all pc's on the network will be able to access. They should all be able to execute the script without having to install additional modules. All the pc's have python installed but do not have pyxml, which the script needs. I don't want to install pyxml on each pc. In this situation distutils is not the ideal solution.

Is it possible to copy the entire pyxml module into the same folder as my script and modify the import statements? Will the scirpt then look in this folder as opposed to the default python install directory? And how exactly will the import statement look like?

Thanks for the help so far.
Mar 11 '08 #5
314 Contributor
Is it possible to copy the entire pyxml module into the same folder as my script and modify the import statements? Will the scirpt then look in this folder as opposed to the default python install directory? And how exactly will the import statement look like?
I'm not entirely positive but I'm pretty sure that the import command will look in the current working directory before looking elsewhere (python install dir)... so you shouldn't have to change the import command at all. As long as it's in the working directory it'll work without a hitch.

It may not look there FIRST per say, but if it finds it there after a fail in the default install directory it'll still work seamlessly. You could always modify the sys.path variable before doing the import.

Expand|Select|Wrap|Line Numbers
  1. import sys, os
  2. sys.path.insert(0, os.getcwd()) # this could also be another path where pyxml is contained
  3. import pyxml
  4. ...
Mar 11 '08 #6
5 New Member
Well that was pretty straight forward... Thanks jlm699!
Mar 11 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

by: NEWS | last post by:
Can I install Python on a networked server and have any user run Python programs without having to go through the 9Mb client install? What are my options for distributing Python programs to my users? Thankyou to anyone who can help. Graham
by: Jiri Barton | last post by:
Hi, I'd like to be able to distribute some python modules of my system (plugins) without the source. So far, I have done this by including only the *.pyc files. However, I have recently found they are platform dependent and python version dependent. This approach has been very convenient because I don't have to mess up with __import__ and the like - which seem to be kind of a pain when inter-module dependencies are introduced.
by: Jason | last post by:
A non-python programming friend of mine has said that any programs made with Python must be distributed with, or an alternative link, to the source of the program. Is this true?
by: RickMuller | last post by:
I really appreciate the ease that the distutils make distributing Python modules. However, I have a question about using them to distribute non-Python (i.e. text) data files that support Python modules. Currently when I have data of this type, I parse it into python objects and make a python module from it. In other words, given a data file like % cat grocery_list.txt eggs spam
by: John Phelan | last post by:
I read an article by, by Mike Groh, in Access-VB-SQL Advisor Magazine, Week 37 that concerns me quite a bit on distributing Access Applications commercially. First I need to describe a "commercial version" of my application that I hope to distribute after completing all the beta testing: A. It was developed using MS AccessXP Pro (developers edition), B. It has a front end MyApplication.mdb and a MyAppBbackend_be.mde; the front end is...
by: Finger.Octopus | last post by:
Hello, It has been such a painful thing for me. As I made a program to encrypt files, now I want to distribute that program over other computers. I created .EXE file with py2exe but the "dist" folder makes around 2 mb and it restricts for the python DLL to be within the same folder. Is there any easy way to get this thing done in just one exe file? I mean if I do interfacing with C/C++ will it work for me and if I do interfacing with...
by: Tina I | last post by:
Hi list, Is there a preferred way to distribute programs that depends on third party modules like PyQt, Beautifulsoup etc? I have used setuptools and just having the setup script check for the existence of the required modules. If they're not found I have it exit with a message that it need this or that installed. But this is not very convenient for the end user and I have got a few complaints about it. Am I missing something in...
by: Robert Dailey | last post by:
Hi, I'm creating a set of command-line tools using Python. These tools manage resources for a game I'm working on. However, many people that will be using these tools will not want to install Python on their machines. This would be a very tedious process (for first time users of my tools). Ideally, I would like for someone to be able to use my tools without having to install Python. For example, if I could put python.exe in a
by: xkenneth | last post by:
Hi All, I'll shortly be distributing a number of python applications that use proprietary. The software is part of a much larger system and it will need to be distributed securely. How can i achieve this? Regards, Ken
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.