Print

Print


Hello,

The PYTHONPATH does not have to include Python's own directory, so Python 
knows how to find its own libraries (and those in a sub-directory of 
lib/python2.5 called site-packages).  But PYTHONPATH does have to include 
the relevant CCPN path or else Python does not know how to find that.  Now 
we could play a trick where we insert the relevant directory at start-up, 
but we prefer not to do it that way.  So what you need is (assuming you 
are using bash rather than csh or tcsh):

   export PYTHONPATH=/Users/mp84/Work/ccpnmr/ccpnmr2.1/python

Now that still might not be good enough because of Tcl/Tk.  In the 
pre-compiled releases we set up a script (bin/analysis) which has all the 
environment set up.  So on your Mac this script would look like (if you 
are using our Tcl/Tk, which I assume you are):

export CCPNMR_TOP_DIR="/Users/mp84/Work/ccpnmr"
export PYTHONPATH=".:${CCPNMR_TOP_DIR}/ccpnmr2.1/python"
export LD_LIBRARY_PATH="/Users/mp84/Work/ccpnmr/tcl8.5/lib:/Users/mp84/Work/ccpnmr/tk8.5/lib"
export DYLD_LIBRARY_PATH="/Users/mp84/Work/ccpnmr/tcl8.5/lib:/Users/mp84/Work/ccpnmr/tk8.5/lib"
export TCL_LIBRARY="/Users/mp84/Work/ccpnmr/tcl8.5/lib/tcl8.5"
export TK_LIBRARY="/Users/mp84/Work/ccpnmr/tk8.5/lib/tk8.5"
/Users/mp84/Work/ccpnmr/python2.5/bin/python2.5 -i -O ${CCPNMR_TOP_DIR}/ccpnmr2.1/python/ccpnmr/analysis/AnalysisGui.py $*

I would generally recommend this approach rather than setting the 
environment in .bash_profile (or wherever) because it will not pollute any 
other users of Python / Tcl / Tk.

Wayne

On Sat, 5 Dec 2009, Mark Pfuhl wrote:

> I did as advised (recompiling C code with -arch i386) and at least I now get a new error
> message when I run analysis:
>
> Error, cannot import core CCPN Python modules:
> Maybe your PYTHONPATH environment variable is not set or
> does not contain the current CCPN installation directory.
> Traceback (most recent call last):
>  File "/Users/mp84/Work/ccpnmr/ccpnmr2.1/python/ccpnmr/analysis/AnalysisGui.py", line
> 71, in <module>
>    raise ImportError
> ImportError
>
> I started AnalysisGui.py both with the ccpn version as well as the system copy of python,
> the result is the same. There is also no improvement when I set PYTHONPATH to the
> python2.5 directory that comes with CCPN.
> Any more suggesetions?
> thanks,
> mark
>