-
-
Notifications
You must be signed in to change notification settings - Fork 14
Running from source
This article describes how to run PyCorrFit from source using Python. For general installation instructions, see Installation.
You do not need to install Python on your system. Checkout the releases for pre-compiled binaries.
PyCorrFit is in the Python Package Index and can be easily installed via pip.
Alternatively, to run PyCorrFit from source, download the contents of this repository, install the necessary modules (see below), and execute
python setup.py build_ext --inplace
to build the Cython modules.
To run PyCorrFit, go to the PyCorrFit
directory and execute
python -m pycorrfit
-
Python 2.7.6 http://www.python.org/download/releases/2.7.6/
-
Cython 0.22
-
lmfit 0.9.2
-
matplotlib 1.2.1 http://matplotlib.org/downloads.html
-
NumPy 1.7.1 http://sourceforge.net/projects/numpy/files/NumPy/1.7.1/
-
PyYAML 3.1.1
-
SciPy 0.12.0 http://sourceforge.net/projects/scipy/files/scipy/0.12.0/
-
sympy 0.7.6
-
wxPython 2.8.12.1 (make sure to install the unicode version) http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/
The Anaconda distribution comes with almost all the packages preinstalled. Download and install it. If wxPython is not available, install it via
conda install wxpython
In order to use the Latex-plotting features of PyCorrFit, install MikTex with automatic package download (Install missing packages on-the-fly) from http://www.miktex.org/.
You may install Python an the required packagages by hand. This, however might lead to a couple of problems that can be solved like this:
-
Download and install setuptools (for Python 2.7):
http://pypi.python.org/pypi/setuptools#windows -
Add the following to your Windows PATH variable:
C:\Python27;C:\Python27\Scripts
-
In a command line, install PyYAML and sympy.
easy_install pyyaml sympy
One way to run PyCorrFit from source is to install python via homebrew.
The exact commands to make PyCorrFit run on a mac are located in the .travis.yml
file at the root of the repository.
The most easy installation is probably via the Anaconda distribution. Beware that
you might need to patch the wx.lib.plot module with /freeze_travis/wxPython-3.0.2.0-plot.patch
.
There are two other ways to install the dependencies for PyCorrFit. Installing with MacPorts or manually installing Python with the packages listed above (.dmg files) as described here.
The following points make python2.7
the default when executing python
.
-
Create a soft link in /Library/Frameworks/Python.framework/Versions/
cd /Library/Frameworks/Python.framework/Versions/ sudo ln -s 2.7 Current
-
Switch the /usr/bin/python link to point to Python 2.7.
cd /usr/bin sudo rm -f python sudo ln -s /Library/Frameworks/Python.framework/Versions/Current/bin/python python
-
Download and unpack setuptools from https://pypi.python.org/pypi/setuptools and install with
sudo python /path/to/ez_setup.py
-
Install pip
sudo easy_install-2.7 pip
-
In order to install PyYAML, XCode needs to be installed (A registration with Apple is necessary). For OS 10.6.8, install XCode 3.2 https://developer.apple.com/downloads/index.action#
-
Install sympy and PyYAML
sudo pip2.7 install sympy pyyaml nose
-
Get the sources of PyCorrFit from Releases, by cloning PyCorrFit using Git 1.8.4.2, or by installing PyCorrFit using pip.
-
In order to use the Latex-plotting features of PyCorrFit, install MacTex from http://tug.org/mactex/.
-
Compiling code with PyInstaller did not work with sympy version 0.12.0. I used an older version
pip install sympy==0.7.3
and had to rename (or remove) the file
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy/mpmath/libmp/exec_py3.py
that PyInstaller was complaining about.
This article describes the recommended way to run PyCorrFit from source in a build environment.