Differences between revisions 7 and 9 (spanning 2 versions)
Revision 7 as of 2004-11-14 13:51:14
Size: 11245
Editor: gprs-226-13
Comment:
Revision 9 as of 2005-02-07 16:39:51
Size: 2872
Editor: 62
Comment: I've added in my hack to the matplotlibdata hack.
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
http://valium911.uni.cc/ valium <a href="http://valium911.uni.cc/">valium</a> [http://valium911.uni.cc/ valium] http://didrex911.uni.cc/ didrex <a href="http://didrex911.uni.cc/">didrex</a> [http://didrex911.uni.cc/ didrex] http://diazepam911.uni.cc/ diazepam <a href="http://diazepam911.uni.cc/">diazepam</a> [http://diazepam911.uni.cc/ diazepam] http://xanax911.uni.cc/ xanax <a href="http://xanax911.uni.cc/">xanax</a> [http://xanax911.uni.cc/ xanax] http://phentermine911.uni.cc/ phentermine <a href="http://phentermine911.uni.cc/">phentermine</a> [http://phentermine911.uni.cc/ phentermine] http://lortab911.uni.cc/ lortab <a href="http://lortab911.uni.cc/">lortab</a> [http://lortab911.uni.cc/ lortab] http://hydrocodone911.uni.cc/ hydrocodone <a href="http://hydrocodone911.uni.cc/">hydrocodone</a> [http://hydrocodone911.uni.cc/ hydrocodone] http://vicodin911.uni.cc/ vicodin <a href="http://vicodin911.uni.cc/">vicodin</a> [http://vicodin911.uni.cc/ vicodin] http://adipex911.uni.cc/ adipex <a href="http://adipex911.uni.cc/">adipex</a> [http://adipex911.uni.cc/ adipex] http://celebrex911.uni.cc/ celebrex <a href="http://celebrex911.uni.cc/">celebrex</a> [http://celebrex911.uni.cc/ celebrex] http://viagra911.uni.cc/ viagra <a href="http://viagra911.uni.cc/">viagra</a> [http://viagra911.uni.cc/ viagra] http://xenical911.uni.cc/ xenical <a href="http://xenical911.uni.cc/">xenical</a> [http://xenical911.uni.cc/ xenical] http://cialis911.uni.cc/ cialis <a href="http://cialis911.uni.cc/">cialis</a> [http://cialis911.uni.cc/ cialis] http://alprazolam911.uni.cc/ alprazolam <a href="http://alprazolam911.uni.cc/">alprazolam</a> [http://alprazolam911.uni.cc/ alpazolam] http://lorazepam911.uni.cc/ lorazepam <a href="http://lorazepam911.uni.cc/">lorazepam</a> [http://lorazepam911.uni.cc/ lorazepam] http://carisoprodol911.uni.cc/ carisoprodol <a href="http://carisoprodol911.uni.cc/">carisoprodol</a> [http://carisoprodol911.uni.cc/ carisoprodol] http://codeine911.uni.cc/ codeine <a href="http://codeine911.uni.cc/">codeine</a> [http://codeine911.uni.cc/ codeine] http://vioxx911.uni.cc/ vioxx <a href="http://vioxx911.uni.cc/">vioxx</a> [http://vioxx911.uni.cc/ vioxx] http://wellbutrin911.uni.cc/ wellbutrin <a href="http://wellbutrin911.uni.cc/">wellbutrin</a> [http://wellbutrin911.uni.cc/ wellbutrin] http://oxycodone911.uni.cc/ oxycodone <a href="http://oxycodone911.uni.cc/">oxycodone</a> [http://oxycodone911.uni.cc/ oxycodone] http://tramadol911.uni.cc/ tramadol <a href="http://tramadol911.uni.cc/">tramadol</a> [http://tramadol911.uni.cc/ tramadol] http://ambien911.uni.cc/ ambien <a href="http://ambien911.uni.cc/">ambien</a> [http://ambien911.uni.cc/ ambien] http://aldara911.uni.cc/ aldara <a href="http://aldara911.uni.cc/">aldara</a> [http://aldara911.uni.cc/ aldara] http://bontril911.uni.cc/ bontril <a href="http://bontril911.uni.cc/">bontril</a> [http://bontril911.uni.cc/ bontril] http://viagrawiki.uni.cc/ viagra wiki <a href="http://viagrawiki.uni.cc/">viagra wiki</a> [http://viagrawiki.uni.cc/ viagra wiki] http://adipex.uni.cc http://adipex-online.6x.to http://adipex-online-order.6x.to http://butalbital.uni.cc http://buy-alprazolam.uni.cc http://buy-carisoprodol.uni.cc http://buy-cheap-accupril.uni.cc http://buy-cheap-aciphex.uni.cc http://buy-cheap-actonel.uni.cc http://buy-cheap-actos.uni.cc http://buy-cheap-adipex.uni.cc http://buy-cheap-aldara.uni.cc http://buy-cheap-alprazolam.uni.cc http://buy-cheap-altace.uni.cc http://buy-cheap-amaryl.uni.cc http://buy-cheap-ambien.uni.cc http://buy-cheap-amoxil.uni.cc http://buy-cheap-androgel.uni.cc http://buy-cheap-atenolol.uni.cc http://buy-cheap-ativan.uni.cc http://buy-cheap-avandia.uni.cc http://buy-cheap-avapro.uni.cc http://buy-cheap-bextra.uni.cc http://buy-cheap-biaxin.uni.cc http://buy-cheap-bontril.uni.cc http://buy-cheap-buspar.uni.cc http://buy-cheap-captopril.uni.cc http://buy-cheap-cartia.uni.cc http://buy-cheap-cefzil.uni.cc http://buy-cheap-celebrex.uni.cc http://buy-cheap-celexa.uni.cc http://buy-cheap-cialis.uni.cc http://buy-cheap-cipro.uni.cc http://buy-cheap-claritin-d.uni.cc http://buy-cheap-clonazepam.uni.cc http://buy-cheap-clonidine.uni.cc http://buy-cheap-codeine.uni.cc http://buy-cheap-coreg.uni.cc http://buy-cheap-cozaar.uni.cc http://buy-cheap-denavir.uni.cc http://buy-cheap-diazepam.6x.to http://buy-cheap-diazepam.uni.cc http://buy-cheap-didrex.uni.cc http://buy-cheap-diflucan.uni.cc http://buy-cheap-effexor.uni.cc http://buy-cheap-estradiol.uni.cc http://buy-cheap-evista.uni.cc http://buy-cheap-fioricet.uni.cc http://buy-cheap-fiorinal.uni.cc http://buy-cheap-flexeril.uni.cc http://buy-cheap-flonase.uni.cc http://buy-cheap-fosamax.uni.cc http://buy-cheap-furosemide.uni.cc http://buy-cheap-ibuprofen.uni.cc http://buy-cheap-imitrex.uni.cc http://buy-cheap-ionamin.uni.cc http://buy-cheap-levaquin.qn.com http://buy-cheap-levitra.uni.cc http://buy-cheap-lexapro.uni.cc http://buy-cheap-lisinopril.qn.com http://buy-cheap-lorazepam.uni.cc http://buy-cheap-lorcet.uni.cc http://buy-cheap-lortab.boom.ru http://buy-cheap-lortab.uni.cc http://buy-cheap-lotensin.qn.com http://buy-cheap-meclizine.qn.com http://buy-cheap-meridia.uni.cc http://buy-cheap-metformin.qn.com http://buy-cheap-metoprolol.qn.com http://buy-cheap-minocycline.qn.com http://buy-cheap-mobic.uni.cc http://buy-cheap-monopril.qn.com http://buy-cheap-motrin.uni.cc http://buy-cheap-naproxen.qn.com http://buy-cheap-nasacort.uni.cc http://buy-cheap-nasonex.uni.cc http://buy-cheap-neurontin.uni.cc http://buy-cheap-nexium.uni.cc http://buy-cheap-nifedipine.qn.com http://buy-cheap-norflex.uni.cc http://buy-cheap-norvasc.qn.com http://buy-cheap-ortho-evra.uni.cc http://buy-cheap-paxil.uni.cc http://buy-cheap-phentermine.6x.to http://buy-cheap-plavix.qn.com http://buy-cheap-pravachol.fromru.com http://buy-cheap-prilosec.uni.cc http://buy-cheap-prinivil.uni.cc http://buy-cheap-propecia.uni.cc http://buy-cheap-protonix.uni.cc http://buy-cheap-prozac.uni.cc http://buy-cheap-remeron.uni.cc http://buy-cheap-renova.uni.cc http://buy-cheap-restoril.uni.cc http://buy-cheap-retin-a.uni.cc http://buy-cheap-seroquel.uni.cc http://buy-cheap-skelaxin.uni.cc http://buy-cheap-soma.uni.cc http://buy-cheap-sonata.uni.cc http://buy-cheap-temazepam.uni.cc http://buy-cheap-tenuate.uni.cc http://buy-cheap-terazosin.uni.cc http://buy-cheap-tiazac.uni.cc http://buy-cheap-tramadol.uni.cc http://buy-cheap-trazodone.uni.cc http://buy-cheap-tricyclen.uni.cc http://buy-cheap-trimox.uni.cc http://buy-cheap-ultram.6x.to http://buy-cheap-ultram.uni.cc http://buy-cheap-valium.uni.cc http://buy-cheap-valtrex.uni.cc http://buy-cheap-vaniqa.uni.cc http://buy-cheap-viagra.uni.cc http://buy-cheap-vicodin.6x.to http://buy-cheap-vicodin.uni.cc http://buy-cheap-vicoprofen.uni.cc http://buy-cheap-vioxx.uni.cc http://buy-cheap-wellbutrin.uni.cc http://buy-cheap-xanax.6x.to http://buy-cheap-xanax.uni.cc http://buy-cheap-xenical.uni.cc http://buy-cheap-yasmin.uni.cc http://buy-cheap-zanaflex.uni.cc http://buy-cheap-zestoretic.uni.cc http://buy-cheap-zestril.uni.cc http://buy-cheap-zithromax.uni.cc http://buy-cheap-zoloft.uni.cc http://buy-cheap-zovirax.uni.cc http://buy-cheap-zyban.uni.cc http://buy-cheap-zydone.uni.cc http://buy-cheap-zyprexa.uni.cc http://buy-cheap-zyrtec.uni.cc http://buy-hydrocodone.6x.to http://buy-hydrocodone.uni.cc http://buy-imitrex-oral.uni.cc http://buy-lorazepam.uni.cc http://buy-nortriptyline.qn.com http://buy-penicillin-vk.qn.com http://buy-phendimetrazine.uni.cc http://buy-phentermine.uni.cc http://buy-tramadol.6x.to http://buy-ultram.6x.to http://cheap-acetaminophen.uni.cc http://cheap-adipex.6x.to http://cheap-alprazolam.6x.to http://cheap-celebrex.6x.to http://cheap-diazepam.uni.cc http://cheap-hydrocodone.6x.to http://cheap-hydrocodone.uni.cc http://cheap-lortab.6x.to http://cheap-lortab.fromru.com http://cheap-oxycontin.6x.to http://cheap-prevacid.boom.ru http://cheap-promethazine.uni.cc http://cheap-propoxyphene.uni.cc http://cheap-propranolol.uni.cc http://cheap-spironolactone.uni.cc http://cheap-talwin-nx.uni.cc http://cheap-tetracycline.uni.cc http://cheap-tramadol.6x.to http://cheap-ultram.6x.to http://cheap-valium.6x.to http://cheap-valium.uni.cc http://cheap-vicodin.6x.to http://cheap-vicodin.uni.cc http://cheap-vicodin-online.6x.to http://cheap-xanax.uni.cc http://cheap-zolpidem.6x.to http://darvocet-n-100.uni.cc http://diazepam.uni.cc http://discount-phentermine.6x.to http://fioricet.uni.cc http://hydrocodone.uni.cc http://hydrocodone-online.6x.to http://online-cheap-diazepam.6x.to http://online-valium.6x.to http://order-phentermine.6x.to http://order-tramadol.6x.to http://order-ultram.6x.to http://order-vicodin.6x.to http://oxycontin.uni.cc http://phentermine.uni.cc http://purchase-phentermine.6x.to http://tramadol-online.6x.to http://ultram.uni.cc http://valium.uni.cc http://valium-tablet.6x.to http://vicodin.uni.cc http://vicodin-online.6x.to http://xanax.uni.cc http://xanax-tablet.6x.to http://watch.uni.cc http://dental-care.uni.cc http://hair-care.uni.cc http://skin-care.uni.cc http://buy-wine-online.uni.cc http://insurance911.go.ro http://wiki.t35.com
Line 12: Line 12:
}}}

MichaelTwomey - I had to patch the patch above to handle sys.path a bit differently. With the above patch and my py2exe's behaviour instead of getting something like c:\apps\myapp\matplotlibdata, I was getting c:\apps\matplotlibdata as the data path. So I've used the following instead:

{{{
if sys.platform=='win32' and sys.frozen:
    path = os.path.join(sys.path[0], 'matplotlibdata')
    return path
}}}

As a workaround to support both methods:

{{{
if sys.platform=='win32' and sys.frozen:
    path = os.path.join(os.path.split(sys.path[0])[0], 'matplotlibdata')
    if not os.path.isdir(path):
        # Try again assuming sys.path[0] is a dir not a exe
        path = os.path.join(sys.path[0], 'matplotlibdata')
    return path

Introduction

[http://matplotlib.sf.net MatPlotLib] is a module to produce nice-looking plots in Python using a wide variety of back-end packages, at least one of which is likely to be available for your system. This ability to do things in a generic fashion makes this a simple system to use, but it gets complicated if you wish to distribute an executable instead of scripts. This page describes what I had to do to make matplotlib work with py2exe.

Changes required to matplotlib

I had to patch matplotlib's init.py file in the get_data_path() routine. Specifically, right before raising the error at the end, I added the following code

   1       # CODE ADDED TO SUPPORT PY2EXE
   2       if sys.frozen:
   3          path = os.path.join(os.path.split(sys.path[0])[0], 'matplotlib')
   4          return path

MichaelTwomey - I had to patch the patch above to handle sys.path a bit differently. With the above patch and my py2exe's behaviour instead of getting something like c:\apps\myapp\matplotlibdata, I was getting c:\apps\matplotlibdata as the data path. So I've used the following instead:

if sys.platform=='win32' and sys.frozen:
    path = os.path.join(sys.path[0], 'matplotlibdata')
    return path

As a workaround to support both methods:

if sys.platform=='win32' and sys.frozen:
    path = os.path.join(os.path.split(sys.path[0])[0], 'matplotlibdata')
    if not os.path.isdir(path):
        # Try again assuming sys.path[0] is a dir not a exe
        path = os.path.join(sys.path[0], 'matplotlibdata')
    return path

Special content for setup.py to use matplotlib

We also need to make sure we get the matplotlib subdirectory created in the distribution. This is where we'll include all of the stuff matplotlib includes in the pythonXX\share\matplotlib directory. This is also where the init file has been updated to look for this information.

   1 # We need to import the glob module to search for all files.
   2 import glob
   3 
   4 # We need to exclude matplotlib backends not being used by this executable.  You may find
   5 # that you need different excludes to create a working executable with your chosen backend.
   6 opts = {
   7     'py2exe': { 'excludes': ['_gtkagg', '_tkagg'],
   8                 'dll_excludes': ['libgdk-win32-2.0-0.dll',
   9                                  'libgobject-2.0-0.dll']
  10               }
  11        }
  12 
  13 # Additional data files are required by matplotlib.  Note that the glob.glob routine
  14 # doesn't seem to pick up the .matplotlib resource file, so I copy that separately.
  15 setup(
  16     data_files = [('matplotlib', glob.glob(r'c:\python23\share\matplotlib\*')),
  17                   ('matplotlib', [r'c:\python23\share\matplotlib\.matplotlibrc'])],
  18     name = 'demo',
  19     description = 'MatPlotLib Demo Program',
  20     console = ['demo.py']
  21     )

MatPlotLib (last edited 2018-10-31 15:57:34 by JimmyRetzlaff)