spacetelescope / awesimsoss

Advanced Webb Exposure SIMulator for SOSS
MIT License
3 stars 7 forks source link

Cannot import package after installing with pip. #32

Open talensgj opened 5 years ago

talensgj commented 5 years ago

When installing with pip the installation seems to complete successfully, but import fails with: ModuleNotFoundError.

hover2pi commented 4 years ago

@talensgj Try to install it with:

git clone https://github.com/spacetelescope/awesimsoss.git
cd awesimsoss
conda env create --name awesimsoss -f environment.yml
conda activate awesimsoss
python setup.py develop

Please let me know if that works or not!

talensgj commented 4 years ago

Unfortunately not. running the conda env create line fails with the error ResolvePackageNotFound for a long list of packages.

Collecting package metadata (repodata.json): done Solving environment: failed

ResolvePackageNotFound:

talensgj commented 4 years ago

Hi, I've now managed to install the package after making a number of modifications to the yaml file.

  1. Removed the build codes on every line.
  2. Changed == to >= for libcxx, llvm-openmp and libcxxabi
  3. Change libgfortran=3.0.1 to libgfortran=3.0.0
  4. Removed appnope Points 3 and 4 appear to be a difference between the conda libraries between osx and linux.

It might be a good idea to try and make the yaml file more minimal, as it appears to contain packages (like appnope) that aren't needed to run awesimsoss.

On a side note when running TSO.simulate() I run out of memory, roughly how much memory is required to run this step?

njcuk9999 commented 4 years ago

I also couldn't get this to install following the instructions. I ended up doing it from a astroconda environment (as to have the dependencies of jwst and webbpsf)

My exact steps were as follows:

conda update conda
conda config --add channels conda-forge
conda config --add channels http://ssb.stsci.edu/astroconda

conda create --name jwst_soss stsci
conda activate jwst_soss
pip install git+https://github.com/spacetelescope/jwst
conda install batman

git clone https://github.com/spacetelescope/awesimsoss
cd awesimsoss
python setup.py develop
cd ..
git clone https://github.com/hover2pi/hotsoss
cd hotsoss
python setup.py develop
cd ..
pip install svo_filters

I also confirm @talensgj comment about memory. I cannot run this on a laptop (Linux) get a memory error straight away (the array it is trying to copy is huge). Only on a machine with 128 GB raw can I get this to even run on your minimum example in the read me. If a vast amount of RAM is a requirement it should be more clearly stated or the methodology re-addressed to make this more user friendly.

pearsonkyle commented 4 years ago

Found a different error when trying to install from the yaml:

(base) kpearson:~/Programs/exoplanets/JWST/awesimsoss$ conda env create --name soss-sim -f environment.yml
/Users/kpearson/anaconda3/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound: 
  - namedlist==1.7=py36_1
pearsonkyle commented 4 years ago

Additionally, here is the error I get after removing that package from the yaml and attempting to install


wheel-0.33.4         | 34 KB     | ############################################################################################# | 100% 
py-1.8.0             | 146 KB    | ############################################################################################# | 100% 
sphinxcontrib-websup | 33 KB     | ############################################################################################# | 100% 
semantic_version-2.6 | 19 KB     | ############################################################################################# | 100% 
requests-2.22.0      | 84 KB     | ############################################################################################# | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: \ b'Enabling notebook extension jupyter-js-widgets/extension...\n      - Validating: \x1b[32mOK\x1b[0m\n'
done
Ran pip subprocess with arguments:
['/Users/kpearson/anaconda3/envs/jwst-soss/bin/python', '-m', 'pip', 'install', '-U', '-r', '/Users/kpearson/Programs/exoplanets/JWST/awesimsoss/condaenv.t88m6186.requirements.txt']
Pip subprocess output:
Collecting asteval==0.9.14 (from -r /Users/kpearson/Programs/exoplanets/JWST/awesimsoss/condaenv.t88m6186.requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/ee/a1/c6273e6cbebe0b9e2e620ae78d535cdf0e4b972656f3271590cd0fa8b6de/asteval-0.9.14.tar.gz (52kB)
Collecting awesimsoss==0.3.1 (from -r /Users/kpearson/Programs/exoplanets/JWST/awesimsoss/condaenv.t88m6186.requirements.txt (line 2))

Pip subprocess error:
  ERROR: Could not find a version that satisfies the requirement awesimsoss==0.3.1 (from -r /Users/kpearson/Programs/exoplanets/JWST/awesimsoss/condaenv.t88m6186.requirements.txt (line 2)) (from versions: none)
ERROR: No matching distribution found for awesimsoss==0.3.1 (from -r /Users/kpearson/Programs/exoplanets/JWST/awesimsoss/condaenv.t88m6186.requirements.txt (line 2))

CondaEnvException: Pip failed
arpita308 commented 3 years ago

I also had trouble installing awesimsoss using conda — similar to issues mentioned above, the package seems to install successfully but then I get a "module not found error". Instead, I git cloned it and manually downloaded several missing files in the awesimsoss/files folder.

hover2pi commented 3 years ago

@arpita308 which files were missing from awesimsoss/files directory? Thanks!

arpita308 commented 3 years ago

@hover2pi As far as I remember, SOSS_CLEAR_PSF.fits and SOSS_F277W_PSF.fits. At first I thought it was all the FITS files, but it was a just a few of them for some reason!