Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError (I think due to numpy dependency) #289

Closed
TomWagg opened this issue Apr 18, 2023 · 3 comments
Closed

ImportError (I think due to numpy dependency) #289

TomWagg opened this issue Apr 18, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@TomWagg
Copy link

TomWagg commented Apr 18, 2023

Describe the bug
An ImportError occurs when importing exoplanet (will paste below)

To Reproduce

import exoplanet as xo

Expected behavior
It imports.

Your setup (please complete the following information):

  • Version of exoplanet: 0.5.2
  • Operating system: Ubuntu
  • Python version & installation method (pip, conda, etc.): 3.10, conda

Additional context
Here's my conda env

name: radius-valley
channels:
  - defaults
  - conda-forge
dependencies:
  - python >= 3.6
  - pip
  - numpy
  - astropy
  - pandas
  - scipy
  - seaborn
  - matplotlib
  - jupyter
  - jupyterlab
  - ipython
  - exoplanet
  - pip:
    - lightkurve
    - pymc3-ext
    - corner
@TomWagg TomWagg added the bug Something isn't working label Apr 18, 2023
@TomWagg
Copy link
Author

TomWagg commented Apr 18, 2023

ImportError                               Traceback (most recent call last)
Cell In[1], line 1
----> 1 import exoplanet as xo
      2 import lightkurve as lk
      3 import astropy.units as u

File [~/miniconda3/envs/radius-valley/lib/python3.10/site-packages/exoplanet/__init__.py:5](https://file+.vscode-resource.vscode-cdn.net/home/tom/Documents/research/radius-valley/notebooks/~/miniconda3/envs/radius-valley/lib/python3.10/site-packages/exoplanet/__init__.py:5)
      1 # -*- coding: utf-8 -*-
      3 __all__ = ["__version__", "distributions", "orbits", "interp"]
----> 5 from . import distributions, interp, orbits
      6 from .citations import CITATIONS
      7 from .distributions import *  # NOQA

File [~/miniconda3/envs/radius-valley/lib/python3.10/site-packages/exoplanet/distributions/__init__.py:5](https://file+.vscode-resource.vscode-cdn.net/home/tom/Documents/research/radius-valley/notebooks/~/miniconda3/envs/radius-valley/lib/python3.10/site-packages/exoplanet/distributions/__init__.py:5)
      1 # -*- coding: utf-8 -*-
      3 __all__ = ["QuadLimbDark", "ImpactParameter", "eccentricity"]
----> 5 from . import eccentricity
      6 from .physical import ImpactParameter, QuadLimbDark

File [~/miniconda3/envs/radius-valley/lib/python3.10/site-packages/exoplanet/distributions/eccentricity.py:7](https://file+.vscode-resource.vscode-cdn.net/home/tom/Documents/research/radius-valley/notebooks/~/miniconda3/envs/radius-valley/lib/python3.10/site-packages/exoplanet/distributions/eccentricity.py:7)
      5 import aesara_theano_fallback.tensor as tt
      6 import numpy as np
----> 7 import pymc3 as pm
      9 from ..citations import add_citations_to_model
...
---> 21 from numpy import asscalar, ndarray
     24 LATEX_ESCAPE_RE = re.compile(r"(%|_|\$|#|&)", re.MULTILINE)
     27 def escape_latex(strng):

ImportError: cannot import name 'asscalar' from 'numpy' ([/home/tom/miniconda3/envs/radius-valley/lib/python3.10/site-packages/numpy/__init__.py](https://file+.vscode-resource.vscode-cdn.net/home/tom/miniconda3/envs/radius-valley/lib/python3.10/site-packages/numpy/__init__.py))

I think this is because my numpy version is too recent for exoplanet? (see here)

@dfm
Copy link
Member

dfm commented Apr 18, 2023

Yeah, PyMC3 requires numpy<1.22:

"numpy<1.22",

Unfortunately since PyMC3 is deprecated there's nothing we can do about it except downgrading numpy!

@TomWagg
Copy link
Author

TomWagg commented Apr 18, 2023

Okay gotcha, I guess something funky happened with my environment installation that ignored that < 1.22 🤷🏻 Thanks!

@TomWagg TomWagg closed this as completed Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants