Unable to load module on COnnectPortX4

I am using the connectport to connect to interrogate a website and need to import
mechanize, html2text and BeautifulSoup. I am getting an error: unable to load module for all three when I try to run them on the connectport i.e. after bo a=r, then fails after python dia.py dia.yml.
I have installed all three properly on my PC (I believe) and can use them successfully on the IDLE GUI. What am I missing?

Product: ConnectPort X4 - ZB - Cellular ( 2G / 3G / 4G )
Os: Microsoft Windows XP
Driver/Firmware: ConnectPort X4_Connect WAN 3G 32MB POST Firmware_82001753_H.bin
ConnectPort X4 ver. 2.14.1 EOS firmware_82001536_K.bin

The Dia build process won’t understand to import ‘foreign’ tools - it is easy to check, just open/browse the dia.zip file.

If you use the ESP, there is a ‘resources’ directory and EVERYTHING placed inside of it gets included in the upload.

Alternatively you can manually add them to the dia.zip, or just manually copy the files up to the python directory in the X4.

Note that not all modules can run on the X4, as you often run into ‘run away dependencies’, where A needs B, and B needs C and so on. Worstcase you may need to edit some and remove things you don’t use (for example, HTTPLIB will want gopher … but you are probably NOT browsing to gohper servers)

Lynn, thanks. I am using ESP. I will try all your suggestions and revert back to you.
I will look at:

  1. the resource directory suggestion, and
  2. Manually adding the files to dia.zip, and
  3. Edit files
    Yes, I am NOT browsing to gohper servers.

Hi Lynn,

Ok - some feedback.
In summary: the application now runs as expected (but will monitor until I’m comfortable it is ‘stable’).


  1. I tried a number of things but ended up “manually adding file to dia.zip” as suggested, and this solved the issue I had.


  • Issue 1:
    It seemed to be a round about way to know which modules to add, i.e. I had to run dia.py dia.yml and look at the trace massages to pick up which modules needed to be added. After doing this about four times, I added all the outstanding dependants.

  • Question 1:
    Is there an easier method of finding out which modules may not be included or a list of dependants I will need for the project?

  • Issue 2:
    I tried the “resource directory” suggestion but could not get any joy. I looked around the ESP IDE and tried various things but could not get it right.

  • How does one use this directory to add modules?

  • Issue 3:
    I will be using 3rd party modules in future.

  • Question 3:
    Is there a standard method used/recommended to deal with 3rd party modules (other than your suggestions above)?

I am grateful for your assistance thus far.

Unfortunately, the way Dia selects code to include is I guess ‘black magic’ :slight_smile: I have made suggestions about having it recognize stuff to leave out (like today if a module has a ‘if sys.platform = sunos: import sun-stuff’, then the Sun stuff is included. The programmers got panicky and said "no, no, we can’t touch it or it might break it’.

I am surprised the ‘resource’ directory does work - I haven’t used it but saw someone using SVN complain because ESp was ZIP’ng the .SVN stuff in there :slight_smile:

What I have done in older projects is to create my own ‘project.zip’ which I maintain manually. It is easy to include in Dia.py (you probably need a hacked dia.py), but this has the speed advantage in that ESp no longer needs to upload it every time.

All you need to do is include the ZIP in the python path - such as line 92 in Dia 2.1 (use the sys.path.insert() command).

Ok, got you.
I will most certainly give your ‘project.zip’ approach a shot. It seams most appropriate as a solution.
Thanks for your help.

Project Zip Code (PZC) is a secure CD-ROM program that counts your credit union members and matches them by congressional district, state legislative.This cumbersome and expensive process forced a complete examination of Project Zip Code and an investigation into alternative approaches and solutions.