Skip to content

Instantly share code, notes, and snippets.

@srikanthbojja
Last active May 6, 2022 01:30
Show Gist options
  • Save srikanthbojja/5c4205e37d28e1fb2b5b45e2e907b419 to your computer and use it in GitHub Desktop.
Save srikanthbojja/5c4205e37d28e1fb2b5b45e2e907b419 to your computer and use it in GitHub Desktop.
OASIS installation on Windows
  1. Dowloand and install Anacaonda Python

    https://www.anaconda.com/download/

  2. Download OASIS from the GitHub

    https://github.com/j-friedrich/OASIS/archive/master.zip

  3. Unzip it

  4. Install dependencies

conda install matplotlib numpy scipy cython
pip install ecos
pip install cvxpy
  1. Compile OASIS
python setup.py build_ext --inplace
  1. If the compilation(step 5) ever fails with compiler unavailability warning, clean the temporary files and install a working GCC compiler on windows based on your python version
  • Cleaning temporary files from previous compilation
python setup.py clean --all
  • Python 2.7 and <=3.4 : mingw
conda install mingw libpython
  • Python 3.5=> : MSYS2 mingw-w64
conda install libpython
conda install -c msys2 m2w64-toolchain
  1. Repeat step 5
@OptoManishK
Copy link

I followed above steps which all ran successfully without an error. Then, I tried 1st example code. I got following error:

Traceback (most recent call last):
File "c:\Users\manish\anaconda3\envs\oasis\OASIS-master\examples\fig1.py", line 7, in
from oasis.functions import gen_data
ModuleNotFoundError: No module named 'oasis'

@OptoManishK
Copy link

OptoManishK commented Jun 28, 2021

On further trials the said error was not related to the installation of OASIS. The error appeared when I tried to run the example .py file using visual studio code. Try .ipynb file instead - that runs smoothly without any errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment