Closed RomanAkhmetshyn closed 10 months ago
Also, I really hope this project will transfer from Theano to Jax
you will get errors with Tensors having no len() or something
Is also fixable if you just type starry.config.lazy = False
. This is noted in the tutorial so ignore what I said after But!
Running Starry on Windows Subsystem for Linux
This is pretty much a tutorial on how to run Starry at its current state if you have Windows, but I will also cover some issues I had during installation. As the name suggests, I could only run Starry on Windows Subsystem for Linux. While trying to run on Windows 11, I have faced the same errors posted in these issues:
https://github.com/rodluger/starry/issues/307#issue-1531465851 https://github.com/rodluger/starry/issues/313#issue-1964461771 https://github.com/rodluger/starry/issues/309#issue-1737001574 https://github.com/rodluger/starry/issues/304#issue-1302380756 https://github.com/rodluger/starry/issues/276#issue-836558054 https://github.com/rodluger/starry/issues/302#issue-1197716784 https://github.com/rodluger/starry/issues/281#issue-866743096 https://github.com/rodluger/starry/issues/261#issue-770493757
Most of them are due to Theano (of course) and, I think, incompatible compiler versions that are installed on Windows. So before you read any further, try to look into the issues above, maybe some may help. I'm very thankful to the people who posted them and the authors who provided valuable solutions. Unfortunately, none worked for me.
Friendly message to the authors: please release the main branch version of Starry. The current version installed by "pip install" does not have changes implemented in this post: https://github.com/rodluger/starry/issues/304#issuecomment-1184569511
So here is how I could make Starry work:
1. Install Windows Subsystem for Linux. It is fairly easy and there are many tutorials on this, so I won't cover it. My WSl version: 2.0.9.0 Ubuntu version (on WSL): 22.04.3 LTS
2. Install Python. I followed this guide here: https://www.scriptinghouse.com/2023/11/install-specific-python-version-on-windows-subsystem-for-linux-wsl.html. I downloaded python 3.9.0 using this command
wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
.sudo make install
may not work at first, so type in the WSl terminal these lines:sudo apt install build-essential
sudo apt install libssl-dev libffi-dev libncurses5-dev zlib1g zlib1g-dev libreadline-dev libbz2-dev libsqlite3-dev make gcc
Then head back tocd Python-3.9.0/
, and./configure
make
sudo make install
Check if python is installed by typingpython3 --version
3 Create Python Virtual Environment on WSL. First of all, Starry requires a specific version of Python (3.9.0, that's why I explicitly installed it just in case, although we can create a virtual environment with any version we like) and specific versions of dependencies.
Friendly message to the authors: Please add all dependencies and their required versions to the new release's requirements. (For example tqdm)
Here is a .yaml file that I used for the creation and package installation for the virtual environment:
Note that Starry is not on this list yet We will create an environment using conda. So follow this guide here on how to install miniconda on WSL: https://docs.conda.io/projects/miniconda/en/latest/ Then we will create an environment using
conda env create --name Starry -f /mnt/c/users/YourUserName/starry.yaml
(I saved my .yaml file in my user directory on Windows). You might want to first navigate tominiconda3
directory.4 Install Starry. Now activate your environment using
conda activate Starry
. Runpip install git+https://github.com/rodluger/starry --no-deps
(this is the main branch version of Starry that has some fixes).5 This is not the end though. When you
import starry
in your python code you will still get errors. They will probably be related to exoplanet-core importing pymc instead of pymc3. So you will have to manually open root\miniconda3\envs\Starry\lib\python3.9\site-packages\exoplanet\orbits\keplarian.py and _root\miniconda3\envs\Starry\lib\python3.9\site-packages\exoplanet\light_curves\limbdark.py and changefrom exoplanet_core.pymc import ops
tofrom exoplanet_core.pymc3 import ops
This should work and help you to at least get through the basic Starry tutorial. But! When you implement limb darkening and execute
plt.plot(time, map.flux(xo=xo, yo=yo, ro=ro, zo=zo))
you will get errors with Tensors having no len() or something. A simple fix that worked for me is to add.eval()
every time aftermap.flux()
, likeplt.plot(time, map.flux(xo=xo, yo=yo, ro=ro, zo=zo).eval())
You can then install Spyder in WSL's Starry environment to code directly or integrate WSL with VS Code while being on Windows.Hope that helps.
I may have missed something, so if you get any errors reproducing my steps, feel free to comment. I will try to help, but I'm probably the least skillful person using Starry in terms of coding and working with OSs.