Comments (4)
good idea. here are my notes, happy to contribute a PR or have someone steal this into theirs..
Running sms-tools with virtualenv
(this works particularly well for MacOSX users)
Let's assume you aready have virtualenv installed. The purpose of virtualenv is to isolate software installations to their own "virtual environment", which can help avoid dependency conflicts and environment-related bugs.
It seems (so far) the sms-tools
run quite happily with virtualenv.
However, special considerations are required due to restrictions of the matplotlib library used in the python code - see Working with Matplotlib in Virtual environments.
The simplest technique that seems to work, is to not activate the virtual environment while using sms-tools
, but instead point the PYTHONHOME
path to the virtual environment folder.
Setup - PYTHONHOME approach
First, choose a place to create the virtualenv folder. One level above the sms-tools folder is a good idea, and venv
is as good a name as any.
Create the venv folder, activate it and make sure it has an up-to-date pip installed (not required, but generally a good idea):
$ virtualenv venv
$ source venv/bin/activate
(venv)$ pip install --upgrade pip
(venv)$ deactivate
Note the critical step: deactivate
the virtualenv.
Instead, set the PYTHONHOME
environment variable to point to venv
(absolute path)
$ export PYTHONHOME=$(cd venv; pwd)
# or set it explicitly:
$ export PYTHONHOME=/some/path/to/venv
Install the sms-tools dependencies (currently there is no requirements.txt for this), and compile the utilFunctions_C
:
$ pip install ipython numpy matplotlib scipy cython
$ cd $PYTHONHOME/../sms-tools/software/models/utilFunctions_C
$ python compileModule.py build_ext --inplace
Now test it out with models_GUI.py
.
First you will need to apply a minor edit for models_GUI.py
using this fix for Matplotlib crashing on Mac OS X
$ cd $PYTHONHOME/../sms-tools/software/models_interface
$ python models_GUI.py
.. and the sms-tools models GUI should pop up and be fully functional.
from sms-tools.
I've just been trying to set the repo up in a virtualenv on OS X. Particularly there seem to be some fragile corners around setting up matplotlib. Documentation would be useful if you're willing!
Thanks.
from sms-tools.
Oh, a way I found around the matplotlib issue described in that link was to install a 1.4 version.
So within the virtual env:
pip install 'matplotlib<1.5.0'
Maybe there's a neater way of using 1.5 but as a temporary solution this works for me.
from sms-tools.
this is not an sms-tools problem, closing.
from sms-tools.
Related Issues (20)
- module 'utilFunctions_C' has no attribute 'twm' HOT 3
- Sms
- HPS Morph transformation error HOT 1
- some button labels invisible in osx
- Sjd
- problem with cutilFunctions.pyx
- SMS
- Why the STFT calculated by SMS tool and Librosa is different? HOT 1
- Ubuntu installation instructions seem to not be working HOT 2
- Inconsistent use of tabs and spaces
- models_GUI.py and models_transformations_GUI.py don't run in python3 HOT 2
- Python 3.9 changes for compatibility and to remove exceptions. HOT 2
- Bad indices in stochastic and hpsmorph transformations HOT 1
- A4Part3 instruction exercice should be fixed
- NameError: name 'filedialog' is not defined HOT 1
- module 'numpy' has no attribute 'float' HOT 2
- Transformations_GUI issues on Python 3.11.1 (and 3.9.6) HOT 1
- utilsFunctions c function not compiling correctly on MacOSX? HOT 1
- ValueError: operands could not be broadcast together with shapes (100,) (0,)
- Transformation-GUI - HPS Morph
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sms-tools.