Skip to content

Instantly share code, notes, and snippets.

@chaithyagr
Last active January 13, 2022 16:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaithyagr/4104df91fbebf44fce1589e96baa6eda to your computer and use it in GitHub Desktop.
Save chaithyagr/4104df91fbebf44fce1589e96baa6eda to your computer and use it in GitHub Desktop.
Install pysap for Windows using WSL (with sparse2d)
  1. Go to Powershell. In most recent windows, the WSL (Windows subsystem for Linux) is usually pre installed. If not, update the Windows and make sure you have Windows 10 or higher.

  2. Intall: wsl --install -d Ubuntu-18.04

    • Note that you have to decide a unix username and pasword
  3. AT the end of this you should have a working WSL for Ubuntu-18.04. Now do the following steps on this WSL (This is kinda similar to here:

    1. Once inside, download and install Miniconda3 :
       wget https://repo.anaconda.com/miniconda/Miniconda3-4.7.12-Linux-x86_64.sh
       bash Miniconda3-4.7.12-Linux-x86_64.sh
      
      Follow through the instructions (mostly yes, and install path etc.). This can also be looked up on google.
    2. Update the package lists : sudo apt update
    3. Install core required libraries: sudo apt install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal gnome-core libxcursor-dev alsa libegl1-mesa libegl1 cmake build-essential (This will take time, say yes for a prompt in between)
    4. Source bashrc to take up latest changes: source ~/.bashrc
    5. Install spyder: conda install matplotlib spyder scipy (This will also take some time)
    6. Install libnfft3: sudo apt install libnfft3-dev
    7. Upgrade pip : pip install --upgrade pip
    8. Install pysap and plugins: pip install python-pysap pynfft2 pyqt5==5.12 pyqtwebengine==5.12
    9. Update the bash file to have display setup. For this, in file ~/.bashrc add the following lines at the end:
      DISPLAY=:0
      export DISPLAY
      LIBGL_ALWAYS_INDIRECT=1
      export LIBGL_ALWAYS_INDIRECT
      
    10. Again source bashrc: source ~/.bashrc
  4. Back on windows:

    • Download and install VncXsrv
    • Start VncXsrv and in settings on first page, ensure Display is 0. Rest of settings can be default.
  5. You should ideally be ready. Run dbus-launch gnome-terminal on Ubuntu. You should get a terminal from ubuntu. On this, you can launch spyder to get an IDE. By default, the base environment now should hold python-pysap

@OlivierMesnil
Copy link

pip install pyqt5==5.12 pyqtwebengine==5.12
(insert below Install spyder: conda install matplotlib spyder scipy)

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