In the flarestack folder in my terminal, it throws me me errors saying there is no module named numpy, even though I ran sudo pip3 install -U numpy
It also tells me that there is invalid syntax in some places. What can I do?
To Reproduce
Steps to reproduce the behavior:
advait@advait-dhingra:~/Documents/Coding/flarestack$ python -m unittest discover tests/
EEEEEEEEEEEEEEEEEEEEE
======================================================================
ERROR: test_likelihood_spatial (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_likelihood_spatial
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_likelihood_spatial.py", line 2, in <module>
from flarestack.data.public import icecube_ps_3_year
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_util_custom_dataset (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_util_custom_dataset
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_util_custom_dataset.py", line 6, in <module>
from flarestack.data.public import icecube_ps_3_year
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_likelihood_standard_matrix (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_likelihood_standard_matrix
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_likelihood_standard_matrix.py", line 6, in <module>
from flarestack.data.public import icecube_ps_3_year
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_asimov_estimator (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_asimov_estimator
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_asimov_estimator.py", line 5, in <module>
import numpy as np
ImportError: No module named numpy
======================================================================
ERROR: test_mh_fit_weights (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_mh_fit_weights
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_mh_fit_weights.py", line 6, in <module>
from flarestack.data.public import icecube_ps_3_year
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_simulate_catalogue (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_simulate_catalogue
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_simulate_catalogue.py", line 6, in <module>
from flarestack.utils import load_catalogue
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_util_astronomy (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_util_astronomy
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_util_astronomy.py", line 6, in <module>
from flarestack.analyses.tde.shared_TDE import tde_catalogue_name
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_mh_flare (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_mh_flare
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_mh_flare.py", line 6, in <module>
from flarestack import MinimisationHandler, analyse
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_cosmo_rates (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_cosmo_rates
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_cosmo_rates.py", line 3, in <module>
import numpy as np
ImportError: No module named numpy
======================================================================
ERROR: test_full_analysis_chain (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_full_analysis_chain
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_full_analysis_chain.py", line 58
"name": f"{base_name}/{gamma}/",
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_submitter (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_submitter
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_submitter.py", line 5, in <module>
from flarestack.shared import flux_to_k
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_likelihood_standard (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_likelihood_standard
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_likelihood_standard.py", line 6, in <module>
import numpy as np
ImportError: No module named numpy
======================================================================
ERROR: test_likelihood_standard_overlapping (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_likelihood_standard_overlapping
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_likelihood_standard_overlapping.py", line 6, in <module>
from flarestack.data.public import icecube_ps_3_year
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_mh_fixed_weights (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_mh_fixed_weights
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_mh_fixed_weights.py", line 6, in <module>
from flarestack.data.public import icecube_ps_3_year
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_time_pdfs (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_time_pdfs
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_time_pdfs.py", line 6, in <module>
from flarestack.data.public import icecube_ps_3_year
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_cosmo (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_cosmo
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_cosmo.py", line 6, in <module>
from flarestack.cosmo import get_diffuse_flux_at_1GeV, get_diffuse_flux_at_100TeV, \
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_mh_large_catalogue (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_mh_large_catalogue
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_mh_large_catalogue.py", line 6, in <module>
from flarestack.data.public import icecube_ps_3_year
File "flarestack/__init__.py", line 1, in <module>
from flarestack.core.minimisation import MinimisationHandler
File "flarestack/core/minimisation.py", line 73
raise Exception(f"MinimisationHandler dictionary contained both 'fixed_scale' key for "
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_energy_pdfs (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_energy_pdfs
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_energy_pdfs.py", line 7, in <module>
import numpy as np
ImportError: No module named numpy
======================================================================
ERROR: test_negative_ns (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_negative_ns
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_negative_ns.py", line 6, in <module>
import numpy as np
ImportError: No module named numpy
======================================================================
ERROR: test_simcube (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_simcube
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_simcube.py", line 5, in <module>
import numpy as np
ImportError: No module named numpy
======================================================================
ERROR: test_likelihood_fixed_energy (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_likelihood_fixed_energy
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/home/advait/Documents/Coding/flarestack/tests/test_likelihood_fixed_energy.py", line 53
"name": f"tests/test_fixed_energy/{sindec:.2f}/",
^
SyntaxError: invalid syntax
----------------------------------------------------------------------
Ran 21 tests in 0.001s
FAILED (errors=21)