From bf1b67127ddb4f3ac1f5b1620792d8344fb95028 2017-11-02 17:34:55 From: Juan C. Espinoza Date: 2017-11-02 17:34:55 Subject: [PATCH] Fix setup and update readme --- diff --git a/README.md b/README.md index 98574b8..520f3a8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Signal Chain (SCh) is a radar data processing library developed using [Python](w ## Installation -Install system dependencies, clone the latest version from [git](http://jro-dev.igp.gob.pe/rhodecode/schain/) and install it as a normal python package. +Install system dependencies, clone the latest version from [here](http://jro-dev.igp.gob.pe/rhodecode/schain/) and install it as a normal python package. ### Linux based system ``` @@ -16,37 +16,25 @@ $ cd schain $ sudo pip install ./ ``` -**It is recommended to install schain in a virtual environment** -``` -$ sudo pip install virtualenv -$ virtualenv /path/to/virtual --system-site-packages -$ source /path/to/virtual/bin/activate -(virtual) $ cd schain -(virtual) $ pip install ./ - -``` ### MAC Os ``` +$ brew install python $ brew install cartr/qt4/pyqt $ git clone http://jro-dev.igp.gob.pe/rhodecode/schain/ $ cd schain $ pip install ./ ``` -if ```pip install ./``` does not work, install a proper python enviroment, and repeat the steps. -``` -$ brew install python -``` - -### GUI Installation - +**It is recommended to install schain in a virtual environment** ``` -$ sudo apt-get install python-pip python-dev gfortran libpng-dev freetype* libblas-dev liblapack-dev libatlas-base-dev python-qt4 python-tk libssl-dev libhdf5-dev -$ (virtual) bash link_PyQt4.sh +$ virtualenv /path/to/virtual +$ source /path/to/virtual/bin/activate +(virtual) $ cd schain +(virtual) $ pip install ./ +(virtual) $ bash link_PyQt4.sh ``` - ## First Script Read Spectra data (.pdata) - remove dc - plot spectra & RTI diff --git a/link_PyQt4.sh b/link_PyQt4.sh index d5d44cb..bc9f852 100755 --- a/link_PyQt4.sh +++ b/link_PyQt4.sh @@ -1,8 +1,5 @@ #!/bin/bash # This hook is run after a new virtualenv is activated. -# ~/.virtualenvs/postmkvirtualenv - -libs=( PyQt4 sip.so ) python_version=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))") var=( $(which -a $python_version) ) @@ -10,8 +7,9 @@ var=( $(which -a $python_version) ) get_python_lib_cmd="from distutils.sysconfig import get_python_lib; print (get_python_lib())" lib_virtualenv_path=$(python -c "$get_python_lib_cmd") lib_system_path=$(${var[-1]} -c "$get_python_lib_cmd") +sip_path=$(ls $lib_system_path/sip*.so) -for lib in ${libs[@]} -do - ln -s $lib_system_path/$lib $lib_virtualenv_path/$lib -done +echo "Linking Qt4..." +ln -s $lib_system_path/PyQt4 $lib_virtualenv_path/PyQt4 +echo "Linking SIP..." +ln -s $sip_path $lib_virtualenv_path/sip.so diff --git a/schainpy/gui/schainGUI b/schainpy/gui/schainGUI index 0fb14e7..b3a8c54 100644 --- a/schainpy/gui/schainGUI +++ b/schainpy/gui/schainGUI @@ -8,7 +8,7 @@ try: from PyQt4.QtGui import QApplication except: log.error( - 'You should install PtQt4 module in order to run the GUI. See the README.') + 'You should install PyQt4 module in order to run the GUI. See the README.') sys.exit() diff --git a/setup.py b/setup.py index 341f7ce..59ba757 100644 --- a/setup.py +++ b/setup.py @@ -8,8 +8,6 @@ import os from setuptools import setup, Extension from setuptools.command.build_ext import build_ext as _build_ext from schainpy import __version__ -from schainpy.utils import log - class build_ext(_build_ext): def finalize_options(self): @@ -19,15 +17,6 @@ class build_ext(_build_ext): import numpy self.include_dirs.append(numpy.get_include()) - -try: - from PyQt4 import QtCore, QtGui - from PyQt4.QtGui import QApplication -except: - log.warning( - 'You should install PyQt4 module in order to run the GUI. See the README.') - - setup(name="schainpy", version=__version__, description="Python tools to read, write and process Jicamarca data",