<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>David, Todd, et al. </div>
<div><br>
</div>
<div>There are some problems with canopy and makeMacApp.py. When the python app included in canopy is invoked directly, it does not get the path right to all packages. It can be fixed with changes to pythonhome and pythonpath, but not that easily. I have had
some conversations with Enthought on this, but they don't have a solution to our "use case." For now, </div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>python <path>GSASII.py</div>
<div><br>
</div>
<div>is the solution with canopy. </div>
<div><br>
</div>
<div>Brian</div>
<br>
<div>
<div>On Mar 17, 2014, at 8:21 AM, David Elbert wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Todd,
<div><br>
</div>
<div>Hello from all the way across campus! :)<br>
<div><br>
The problem is that GSAS II is looking at the wrong version of Python or perhaps in the wrong place for some parts of Python. A critical thing for GSAS II is using 32-bit Python because some of the required modules aren�t available in 64-bit. The error message
is a bit of a red herring in that it makes you think you should install the missing module, but it is really a 32-bit versus 64-bit problem because something else that is found in the GSAS-II install is 32-bit and is looking for a 32-bit version of a module
that the system�s Python can�t provide. <br>
<br>
Here is a bit of a rambling note on how you might get GSAS II working. (Sorry, I don�t have time to edit it down and I may be telling you stuff you already know, but maybe it will sit here and help newbies). It�s tricky to get the paths and things right on
a Mac and Apple didn�t do us any favors by changing things up in different versions of the operating system. Python uses virtual environments to allow one to have different configurations for different applications, but it can be very hard to know just how
to get into the right virtual environment with a generic app like the one GSAS II creates. I don�t have Mavericks, but run it in Snow Leopard and find the following works:<br>
<br>
1. Install 32-bit Enthought Canopy Python. Where I differ from the online install instructions is that I skipped the Canopy Gui and did this:<br>
</div>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>a. downloaded 32-bit canopy and put it in the Applications folder</div>
<div>b. installed a simple, command line version of Canopy Python from the terminal using:</div>
<div><br>
</div>
</blockquote>
<div>/Applications/Canopy.app/Contents/MacOS/Canopy_cli setup /Users/username/canopy --default</div>
<div><br>
</div>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>c. edited my .bash_profile file to make sure it has the following two lines uncommented:</div>
<div><br>
</div>
</blockquote>
<div>export PATH=/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}<br>
VIRTUAL_ENV_DISABLE_PROMPT=1 source /Users/username/canopy/bin/activate<br>
<br>
Note: The first line establishes the path for the normal, system Python in Snow Leopard; I don�t know if that is right for Mavericks. The second line means that when anything (you or an app) opens a Bash shell, the Canopy virtual environment will be activated. Test
that like this:</div>
<div><br>
</div>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>1. Open a Terminal shell</div>
<div>2. Type �which python� and see that the result is a path to /Users/username/canopy/bin/python</div>
<div>3. Check that you have the 32-bit running by typing:</div>
</blockquote>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>�Python�</div>
</blockquote>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>import sys</div>
</blockquote>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>sys.maxsize</div>
<div><br>
</div>
</blockquote>
</blockquote>
<div>The result should be something like 2147483647. If the result is 9223372036854775807 you are running 64-bit Python and have to back up and figure out if you installed the wrong version in ~/canopy.</div>
<div><br>
Note: If you need to run the regular, system Python you can always go into a Terminal shell and type �deactivate�. Or go into your .bash_profile and comment out the virtual environment line. You may want to do this when you are not routinely running GSAS II.</div>
<div><br>
Assuming that is all working, you can now install and run GSAS II. Make a directory for it, download the bootstrap.py file and put it in that directory. Open a Terminal shell and type �python bootstrap.py�. It is best to do this after you have already gotten
your Python installation set and working in Canopy 32-bit. If you did it from the wrong Python you may have trouble later like missing things that aren�t available in the 64-bit version. In your case, make a new directory and run the bootstrap script anew
once you have 32-bit Python working.</div>
<div><br>
Now you have a choice. One of the last (maybe the last) step in the bootstrap installation is the creation of an AppleScript app called GSAS-II that you double click to launch GSAS II. This is created by a Python script called makeMacApp.py and if you look
at it in an editor you will see that it counts on using an environment variable called pythonhome to know where to look for the Python to boot. In my experience, that doesn�t work because pythonhome isn�t set in most people�s systems and it is hard to get
pythonhome to point to the right thing; I suspect there is something about pythonhome and pythonpath on Macs that I don�t understand. When you double click the GSAS-II application created by makeMacApp.py what you do is start the system Python instead of
that 32-bit Canopy version with all the right modules loaded and you get the error message that brought you to this forum. Your choice is to fix the makeMacApp script to suit your personal installation and version of Mac OS, or do what I do. What I do is
simply open a Terminal shell and type:</div>
<div><br>
</div>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>cd GSASII</div>
<div>python GSASII.py</div>
</blockquote>
<div><br>
GSAS II opens its windows and off you go.</div>
<div><br>
</div>
<div>Hope that helps-</div>
<div>David</div>
<div><br>
</div>
<div><br>
<div>
<div>David Elbert<br>
Associate Program Director for Environmental Studies,<br>
Advanced Academic Programs &<br>
Earth and Planetary Sciences<br>
Olin Hall<br>
Johns Hopkins University<br>
</div>
<br>
<br>
<br>
</div>
<br>
</div>
</div>
</div>
_______________________________________________<br>
GSAS-II mailing list<br>
<a href="mailto:GSAS-II@mailman.aps.anl.gov">GSAS-II@mailman.aps.anl.gov</a><br>
https://mailman.aps.anl.gov/mailman/listinfo/gsas-ii<br>
</blockquote>
</div>
<br>
<div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">
<div><span class="Apple-style-span" style="font-size: 12px; "><font class="Apple-style-span" face="Courier">********************************************************************</font></span>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; ">
<font class="Apple-style-span" face="Courier">Brian H. Toby, Ph.D. office: 630-252-5488</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; ">
<font class="Apple-style-span" face="Courier">Senior Physicist/Section Head for Scientific Software</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; ">
<font class="Apple-style-span" face="Courier">Advanced Photon Source</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; ">
<font class="Apple-style-span" face="Courier">9700 S. Cass Ave, Bldg. 401/B4192 work cell: 630-327-8426 </font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; ">
<font class="Apple-style-span" face="Courier">Argonne National Laboratory </font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; ">
<font class="Apple-style-span" face="Courier">Argonne, IL 60439-4856 e-mail: brian dot toby at anl dot gov </font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; ">
<font class="Apple-style-span" face="Courier">********************************************************************</font></div>
<div style="font-size: 12px; "><font class="Apple-style-span" face="Courier">"<span class="Apple-style-span" style="font-family: Helvetica; ">We will restore science to its rightful place, and wield technology's wonders... We will harness the sun and the winds
and the soil to fuel our cars and run our factories... All this we can do. All this we will do."</span></font></div>
</div>
</span></div>
<br>
</body>
</html>