Warning
Marvin does not work well with the system Python in OSX.
Please, make sure you are using a supported Python installation before
following these instructions. Good installations include
Anaconda,
Miniconda, or
homebrew. After installing one of these distribution,
make sure you are actually using it by running which python
and which pip
.
Painless Installation:
pip install sdss-marvin
Attention
If pip fails while installing python-memcached
, make sure that you have the latest version of setuptools
by running pip install -U setuptools
. Then, try running pip install sdss-marvin
again.
or to upgrade an existing Marvin installation:
pip install --upgrade sdss-marvin
Hint
By default, pip
will update any underlying package on which marvin depends. If you want to prevent that you can upgrade marvin with pip install -U --no-deps sdss-marvin
. This could, however, make marvin to not work correctly. Instead, you can try pip install -U --upgrade-strategy only-if-needed sdss-marvin
, which will upgrade a dependency only if needed.
Developer Installation (Medium Pain):
git clone https://github.com/sdss/marvin
cd marvin
git submodule init
git submodule update
python setup.py install
If you experience problem after the installation, check the Frequently Asked Questions.
While Marvin is now publicly available, not all MaNGA data is so. As a result,
you need to add some configuration to allow you to access proprietary data. To
do that, create and edit a file in your home called .netrc
an copy
these lines inside:
machine api.sdss.org
login sdss
password <password>
machine data.sdss.org
login sdss
password <password>
and replace <password>
with the default SDSS data password. Finally, run
chmod 600 ~/.netrc
to make the file only accessible to your user.
Marvin depends on three pieces of SDSS-wide software:
For convenience, marvin includes these products as external libraries. This means that
you most likely do not need to worry about any of these products. However, if any
of these libraries are already installed in your system (i.e., you have defined
$MARVIN_BRAIN_DIR
, $TREE_DIR
, or $SDSS_ACCESS_DIR
), marvin will use the system
wide products instead of its own versions. This is useful for development but note that
it can also lead to confusions about what version marvin is using.
Marvin requires a certain environment structure to access and (optionally) download data. By default,
marvin will look for data files in a directory structure that mirrors the
Science Archive Server. Data downloaded via marvin will
also be stored according to that structure. The root of this directory structure is
defined by the environment variable $SAS_BASE_DIR
. For example, if marvin needs
to use the drpall
file for MPL-5, it will try to find it in
$SAS_BASE_DIR/mangawork/manga/spectro/redux/v2_0_1/drpall-v2_0_1.fits
.
The Marvin environment structure is as follows:
====================== ==============================================
Environment Variable Default Path
====================== ==============================================
SAS_BASE_DIR $HOME/sas
MANGA_SPECTRO_REDUX $SAS_BASE_DIR/mangawork/manga/spectro/redux
MANGA_SPECTRO_ANALYSIS $SAS_BASE_DIR/mangawork/manga/spectro/analysis
====================== ==============================================
Marvin will check for these environment variables in your local system. If the above environment variables are
not already defined, Marvin will use the specifed default paths. Otherwise Marvin will adopt your custom paths.
If you wish to define custom paths, you can update the environment variable paths in your
.bashrc
or .cshrc
file. As a general advice, if you are
not using other products that require setting those environment variables, you should only
define $SAS_BASE_DIR
(or not define it and let Marvin configure itself).
If you plan to work with Marvin interactively, from the Python terminal, we recommend you use
IPython, which provides many nice features such as autocompletion,
between history, color coding, etc. It’s also especially useful if you plan to use Matplotlib,
as IPython comes with default interactive plotting. If you installed Python via the Anaconda or Miniconda
distributions, then you already have IPython installed. Just run ipython
in your terminal. If you
need to install it, do pip install jupyter
.
Important
We can use your help to expand this section. If you have encountered an issue or have questions that should be addressed here, please submit and issue.
Just do pip install --upgrade sdss-marvin
. Marvin will get updated to the latest
version, along with all the dependencies. If you want to update marvin but keep other
packages in their currrent versions, do
pip install --upgrade --upgrade-strategy only-if-needed sdss-marvin
. This will only
update dependencies if marvin does need it.
If your Marvin installation fails at any point during the pip install process with permissions problems,
try running sudo pip install sdss-marvin
. Note that an Anaconda or Homebrew distribution will not require
permissions when pip installing things, so if you are receiving permissions errors, you may want to check that
you are not using the Mac OSX system version of Python.
If you receive a permissions error regarding pip
attempting to install a package in a different directory other
than the Anaconda one, e.g. /lib/python3.6
, try following the solution indicated in Marvin Issue 373
Marvin is built to have you started with minimum configuration on your part. This means that marvin is likely to import but maybe not all features will be available. Here are a few commands you can try that will inform you if there are problems with your installation.
From a terminal window, type:
check_marvin
This will perform a variety of checks with Marvin and output the results to the terminal. We may ask you for this output when diagnosing any installation issues. After installing marvin, start a python/ipython session and run:
import marvin
print(marvin.config.urlmap)
If you get a dictionary with API routes, marvin is connecting correctly to the API server at
Utah and you can use the remote features. If you get None
, you may want to
check the steps in Set up your netrc. If you get an error message such as
BrainError: Requests Timeout Error: HTTPSConnectionPool(host='api.sdss.org', port=443): Read timed out.
Your request took longer than 5 minutes and timed out. Please try again or simplify your request.
this means the servers at Utah have timed out and may possibly be down. Simply wait and try again later.
If the above test crashes, or you attempt to use a Marvin Tool remotely, and you see this error:
AttributeError: 'Extensions' object has no attribute 'get_extension_for_class'
This is an issue with the Urllib and Requests python package. See this Issue for an ongoing discussion if this problem has been solved.
Some users have reported that after installing marvin they get an error such as:
Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework.
This problem is caused by matplotlib not being able to use the MacOS backend if you are using
Anaconda. You need to switch your matplolib backend to Agg
or TkAgg
. Follow these instructions to fix
the problem. If you do want to use the MacOS backend, consider installing Python using
homebrew.
If the MPL dropdown list in the top menu bar is blank, or other elements appear to disappear, this is an indication your browser cache is creating conflicts. The solution is to clear your browser cache, close and restart your browser from scratch. You can also clear your browser cookies.
As a reminder, we recommend these browsers for the best Marvin web experience:
Marvin was originally designed to work on Mac or Linux operating systems. However it is possible at the moment to get Marvin working on Windows machines. The following guidelines have been tested on a Windows 10 machine running Python 3.6.
import os
os.environ['HOME'] = '/path/you/want/as/marvin/home/directory'
os.environ['SAS_BASE_DIR'] = os.path.join(os.getenv("HOME"), 'sas')
HOME
path, follow these instructions..netrc
file and place it the directory you designated as HOME
. You will need to modify the permissons of this file to match the expected chmod 600
permissions for Mac/Linux users. When creating the file, you can name it as anything but can rename it to .netrc
from the command prompt.With this, you should be able to run Marvin in windows. You can test it with import marvin
. Currently, Marvin cannot download files due to issues with forward slashes in sdss-access
but this will be fixed soon. We will continue to update these guidelines as we make further progress on a Windows-Marvin installation.