adrn/thejoker

joker installation

caseylam opened this issue · 5 comments

I'm having trouble with installing the joker.

I get a subprocess error when I tried installing with pip, I tried searching the error (ImportError: cannot import name 'update_default_config' from 'astropy.config.configuration') but couldn't find a solution.

$ sudo -H pip install thejoker
DEPRECATION: Loading egg at /opt/mambaforge/envs/joker/lib/python3.11/site-packages/seaborn-0.13.0-py3.11.egg is deprecated. pip 23.3 will enforce this behaviour change. A possible replacement is to use pip for package installation..
Collecting thejoker
  Downloading thejoker-1.2.2.tar.gz (130 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 130.6/130.6 kB 8.1 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      Traceback (most recent call last):
        File "/opt/mambaforge/envs/joker/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/mambaforge/envs/joker/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/mambaforge/envs/joker/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/tmp/pip-build-env-11uklh1m/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/tmp/pip-build-env-11uklh1m/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/tmp/pip-build-env-11uklh1m/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 81, in <module>
        File "/private/tmp/pip-build-env-11uklh1m/overlay/lib/python3.11/site-packages/extension_helpers/_setup_helpers.py", line 67, in get_extensions
          ext_modules.extend(setuppkg.get_extensions())
                             ^^^^^^^^^^^^^^^^^^^^^^^^^
        File "./thejoker/src/setup_package.py", line 10, in get_extensions
          import twobody
        File "/private/tmp/pip-build-env-11uklh1m/overlay/lib/python3.11/site-packages/twobody/__init__.py", line 11, in <module>
          from ._astropy_init import *
        File "/private/tmp/pip-build-env-11uklh1m/overlay/lib/python3.11/site-packages/twobody/_astropy_init.py", line 21, in <module>
          from astropy.config.configuration import (
      ImportError: cannot import name 'update_default_config' from 'astropy.config.configuration' (/private/tmp/pip-build-env-11uklh1m/overlay/lib/python3.11/site-packages/astropy/config/configuration.py)
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I tried pip installing the development version and got the same error:

$ pip install git+https://github.com/adrn/thejoker
Defaulting to user installation because normal site-packages is not writeable
DEPRECATION: Loading egg at /opt/mambaforge/envs/joker/lib/python3.11/site-packages/seaborn-0.13.0-py3.11.egg is deprecated. pip 23.3 will enforce this behaviour change. A possible replacement is to use pip for package installation..
Collecting git+https://github.com/adrn/thejoker
  Cloning https://github.com/adrn/thejoker to /private/var/folders/3g/j8h50xhs6hn0pn2vg6ffgsvh0000gn/T/pip-req-build-qfpnmgzb
  Running command git clone --filter=blob:none --quiet https://github.com/adrn/thejoker /private/var/folders/3g/j8h50xhs6hn0pn2vg6ffgsvh0000gn/T/pip-req-build-qfpnmgzb
  Resolved https://github.com/adrn/thejoker to commit 87ca3ead5b0f6845b747e3fe470ac368f23d59b0
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      Traceback (most recent call last):
        File "/opt/mambaforge/envs/joker/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/mambaforge/envs/joker/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/mambaforge/envs/joker/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/3g/j8h50xhs6hn0pn2vg6ffgsvh0000gn/T/pip-build-env-ipyevfvm/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/3g/j8h50xhs6hn0pn2vg6ffgsvh0000gn/T/pip-build-env-ipyevfvm/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/3g/j8h50xhs6hn0pn2vg6ffgsvh0000gn/T/pip-build-env-ipyevfvm/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 81, in <module>
        File "/private/var/folders/3g/j8h50xhs6hn0pn2vg6ffgsvh0000gn/T/pip-build-env-ipyevfvm/overlay/lib/python3.11/site-packages/extension_helpers/_setup_helpers.py", line 67, in get_extensions
          ext_modules.extend(setuppkg.get_extensions())
                             ^^^^^^^^^^^^^^^^^^^^^^^^^
        File "./thejoker/src/setup_package.py", line 10, in get_extensions
          import twobody
        File "/private/var/folders/3g/j8h50xhs6hn0pn2vg6ffgsvh0000gn/T/pip-build-env-ipyevfvm/overlay/lib/python3.11/site-packages/twobody/__init__.py", line 11, in <module>
          from ._astropy_init import *
        File "/private/var/folders/3g/j8h50xhs6hn0pn2vg6ffgsvh0000gn/T/pip-build-env-ipyevfvm/overlay/lib/python3.11/site-packages/twobody/_astropy_init.py", line 21, in <module>
          from astropy.config.configuration import (
      ImportError: cannot import name 'update_default_config' from 'astropy.config.configuration' (/private/var/folders/3g/j8h50xhs6hn0pn2vg6ffgsvh0000gn/T/pip-build-env-ipyevfvm/overlay/lib/python3.11/site-packages/astropy/config/configuration.py)
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I also tried installing from source.
After I cloned the repo, I had to add "name : thejoker" at the top of the environment.yml file.
There seems to be a problem finding the mkl package though:

$ sudo mamba env create
conda-forge/osx-arm64                                       Using cache
conda-forge/noarch                                          Using cache


Looking for: ['python=3.8', 'mkl', 'pip']


Could not solve for environment specs
The following package could not be installed
└─ mkl   does not exist (perhaps a typo or a missing channel).

I tried then changing the yml file so that mkl was a dependency of pip:

name : thejoker
dependencies:
  - python=3.8
  - pip
  - pip:
    - -e .[docs]
    - mkl

But that didn't work either.

$ sudo mamba env create
conda-forge/osx-arm64                                       Using cache
conda-forge/noarch                                          Using cache


Looking for: ['python=3.8', 'pip']


Transaction

  Prefix: /opt/mambaforge/envs/thejoker

  Updating specs:

   - python=3.8
   - pip


  Package               Version  Build               Channel                     Size
───────────────────────────────────────────────────────────────────────────────────────
  Install:
───────────────────────────────────────────────────────────────────────────────────────

  + bzip2                 1.0.8  h93a5062_5          conda-forge/osx-arm64     Cached
  + ca-certificates  2023.11.17  hf0a4a13_0          conda-forge/osx-arm64     Cached
  + libffi                3.4.2  h3422bc3_5          conda-forge/osx-arm64     Cached
  + libsqlite            3.44.2  h091b4b1_0          conda-forge/osx-arm64     Cached
  + libzlib              1.2.13  h53f4e23_5          conda-forge/osx-arm64     Cached
  + ncurses                 6.4  h463b476_2          conda-forge/osx-arm64     Cached
  + openssl               3.2.0  h0d3ecfb_1          conda-forge/osx-arm64     Cached
  + pip                  23.3.2  pyhd8ed1ab_0        conda-forge/noarch        Cached
  + python               3.8.18  h2469fbe_1_cpython  conda-forge/osx-arm64       13MB
  + readline                8.2  h92ec313_1          conda-forge/osx-arm64     Cached
  + setuptools           69.0.3  pyhd8ed1ab_0        conda-forge/noarch        Cached
  + tk                   8.6.13  h5083fa2_1          conda-forge/osx-arm64     Cached
  + wheel                0.42.0  pyhd8ed1ab_0        conda-forge/noarch        Cached
  + xz                    5.2.6  h57fd34a_0          conda-forge/osx-arm64     Cached

  Summary:

  Install: 14 packages

  Total download: 13MB

───────────────────────────────────────────────────────────────────────────────────────


python                                              13.5MB @  62.7MB/s  0.2s

Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Installing pip dependencies: \ Ran pip subprocess with arguments:
['/opt/mambaforge/envs/thejoker/bin/python', '-m', 'pip', 'install', '-U', '-r', '/Users/clam/scratch/code/thejoker/condaenv.n51slkxf.requirements.txt', '--exists-action=b']
Pip subprocess output:
Obtaining file:///Users/clam/scratch/code/thejoker
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Checking if build backend supports build_editable: started
  Checking if build backend supports build_editable: finished with status 'done'
  Getting requirements to build editable: started
  Getting requirements to build editable: finished with status 'done'
  Preparing editable metadata (pyproject.toml): started
  Preparing editable metadata (pyproject.toml): finished with status 'done'

Pip subprocess error:
WARNING: The directory '/Users/clam/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
ERROR: Could not find a version that satisfies the requirement mkl (from versions: none)
ERROR: No matching distribution found for mkl

failed

CondaEnvException: Pip failed

Not sure what the problem is, any chance you might be able to help?

Thanks!

adrn commented

Thanks for the issue and sorry about this! This is an incompatibility with Astropy v6.0. I just pushed a quick fix (to force astropy < 6.0 on install), but will try to get to actually fixing this issue soon! Try installing the dev version of thejoker now?

pip install git+https://github.com/adrn/thejoker

Thanks for the reply!

I just tried the dev version by running $ sudo -H pip install git+https://github.com/adrn/thejoker but it seems to be giving me the same error as before?

$ sudo -H pip install git+https://github.com/adrn/thejoker
DEPRECATION: Loading egg at /opt/mambaforge/envs/astro/lib/python3.11/site-packages/seaborn-0.13.0-py3.11.egg is deprecated. pip 23.3 will enforce this behaviour change. A possible replacement is to use pip for package installation..
Collecting git+https://github.com/adrn/thejoker
  Cloning https://github.com/adrn/thejoker to /private/tmp/pip-req-build-23ow74da
  Running command git clone --filter=blob:none --quiet https://github.com/adrn/thejoker /private/tmp/pip-req-build-23ow74da
  Resolved https://github.com/adrn/thejoker to commit 47520821fd4a371ddccefcda684f6c24ede77ab2
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      Traceback (most recent call last):
        File "/opt/mambaforge/envs/astro/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/mambaforge/envs/astro/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/mambaforge/envs/astro/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/tmp/pip-build-env-ofpejd0t/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/tmp/pip-build-env-ofpejd0t/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/tmp/pip-build-env-ofpejd0t/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 81, in <module>
        File "/private/tmp/pip-build-env-ofpejd0t/overlay/lib/python3.11/site-packages/extension_helpers/_setup_helpers.py", line 67, in get_extensions
          ext_modules.extend(setuppkg.get_extensions())
                             ^^^^^^^^^^^^^^^^^^^^^^^^^
        File "./thejoker/src/setup_package.py", line 10, in get_extensions
          import twobody
        File "/private/tmp/pip-build-env-ofpejd0t/overlay/lib/python3.11/site-packages/twobody/__init__.py", line 11, in <module>
          from ._astropy_init import *
        File "/private/tmp/pip-build-env-ofpejd0t/overlay/lib/python3.11/site-packages/twobody/_astropy_init.py", line 21, in <module>
          from astropy.config.configuration import (
      ImportError: cannot import name 'update_default_config' from 'astropy.config.configuration' (/private/tmp/pip-build-env-ofpejd0t/overlay/lib/python3.11/site-packages/astropy/config/configuration.py)
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
adrn commented

It turns out this is a deeper issue with dependencies than I had appreciated! The main issue seems to be that exoplanet depends on pymc3, which depends on theano-pymc, which seems to be broken for numpy > 1.20. But these old numpy versions don't have wheels for newer versions of python, and the old versions of numpy don't build from source on my M1 (ARM) mac. I think I can get a version to build with python 3.9, so I'm working on that, and will have to pin some dependencies. I'll let you know when I have more information on that!

I also wanted to let you know that over the next few months, I'm planning to release a new implementation of thejoker that is instead built on jax + numpyro, so a lot of these dependency headaches (due to the pymc3/theano transitions) should get better. But the new version will have an updated API and will require some code to be updated, unfortunately.

adrn commented

Hey @caseylam -- I made a bunch of updates to thejoker and released a new version that now uses pymc instead of pymc3. If it's still relevant, could you give the new version a try?

Thanks for the update---I just tried, and was able to pip install and run The Joker! So I think this can be closed now. Thanks again!