Closed svw26 closed 3 years ago
Sorry, I don't do Macs so I'm not sure how much help I can be. This isn't an issue with installing RSSMOSPipeline, this is a general problem with your python installation (so far as I can see).
I'm not aware that you'd need a virtual environment when using anaconda - if you have anaconda installed and set-up (so that 'python' is launching the anaconda-installed python3), then you should just be able to install RSSMOSPipeline using the setup.py script in the usual way. Similarly, if you have pip installed in your anaconda distribution, that should also work. I'm happily using the pipeline through an anaconda3 installation on one of the machines here (running Linux though, not MacOS). I've never bothered with any virtualenv installs.
Maybe check that you don't have a copy of the script rss_mos_reducer somewhere else in your path (whatever the equivalent of /usr/local/bin is on MacOS)? Perhaps when you run rss_mos_reducer, it's finding one that's using your python2.7 installation? That's just a guess. You might be able to use 'which rss_mos_reducer' to check where the script that you are running has been installed, and then check the first line ('#!/usr/bin env python' would have been re-written with the path to the interpreter that was used to run the setup.py script).
Hey both. Thanks for your quick responses, but unfortunately the Python installations on my Mac got messed up, and I've (still) not had much of a gap to sort things out... Will report back when I do. In the meantime, I pointed my student to your pipeline, @mattyowl . He may open/raise a different issue soon. x
Hiya again,
So I've fixed the installation now (so that it runs within a virtual environment). Not sure which of the hidden files (.bash_profile or .bash_profile-anaconda.bak) made the difference, but I edited the pathnames in both for good measure (changing 'anaconda3' to just 'anaconda'). That at least got me back to reproducing the above Traceback.
Then, following the solution linked by @tushar-nitave (thank you!), I
backend: TkAgg
[Writing this out in case it helps others.]
The ImportError: Python is not installed as a framework
message went away and was replaced by ImportError: No module named 'IPython'
. So just do pip install ipython
.
Running rss_mos_reducer product reduced all
then got me:
2020-10-15 21:57:56,589 - RSSMOSPipeline - INFO - started: 2020-10-15T21:57:56.589505
2020-10-15 21:57:56,589 - RSSMOSPipeline - INFO - parameters: Namespace(excludeMasks='', extensionsList='all', iterativeMethod=False, longslitThreshold=2.0, maskName='all', rawDir='product', reducedDir='reduced', skipDone=False, subFrac=0.8, threshold=0.1)
2020-10-15 21:57:56,590 - RSSMOSPipeline - INFO - Reading image headers (cache file location: product/imageInfo.pkl)
2020-10-15 21:57:56,748 - RSSMOSPipeline - WARNING - Skipping mask 'G4Jy 1657_PL0200N001' as no wavelength calibration reference model currently exists.
2020-10-15 21:57:56,748 - RSSMOSPipeline - INFO - Use rss_mos_create_arc_model to make a reference model and then re-run.
2020-10-15 21:57:56,748 - RSSMOSPipeline - INFO - arc files list: ['product/mbxgpP202010130062.fits']
so I can close this issue now.
Thanks, Sarah x
[EDIT: adding the "(changing 'anaconda3' to just 'anaconda')" bit.]
[Message for myself and other silly Mac users...]
For some other code on my laptop I followed the prompt to update my version of pip, to 21.1.1. This appears to cause all sorts of problems (including recursive ones?) but I have found this: https://stackoverflow.com/questions/65896334/python-pip-broken-with-sys-stderr-writeferror-exc
The following command:
sudo easy_install pip==20.3.4
appears to put things back to some sort of normal (EDIT: confirmed). x
Hiya Matt!
So it's crunch time for me in trying this out this week... :see_no_evil:
I have a new-ish laptop (Mac OS Mojave), but it still only came with Python 2.7 (located at /Users/sarahwhite/anaconda2/bin/python). So I also installed Python 3.5 via another Anaconda (now at /Users/sarahwhite/anaconda3/bin/python). In order to avoid conflicts, I thought I'd best create a virtual environment, specifically for running your pipeline. As Python 2.7 remains the default, I did this using virtualenv as follows:
I then
pip install
all the various packages, and have a go at running the pipeline. As I don't have any masks, I thought I'd try 'all' and see what happens:Unfortunately this gives the following Traceback:
I tried installing the python.app as they suggest,
conda install -c anaconda python.app
, but this just gives me Python-2.7 builds again, and I can't seem to find a Python-3 equivalent...And I get the same Traceback when I instead try using conda to create the virtual environment, using the commands:
So maybe I just need to fix a path somewhere? My head's in a bit of a spin now...
Thanks, Sarah x