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

Updated Python not compatible with Gala? #329

Open
juliaespositon opened this issue Aug 9, 2023 · 10 comments
Open

Updated Python not compatible with Gala? #329

juliaespositon opened this issue Aug 9, 2023 · 10 comments

Comments

@juliaespositon
Copy link

Hi! I recently updated packages + Python and now I am having trouble installing Gala on a newly installed anaconda. I'm getting the following error when I run "pip install gala":

"note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for gala
Failed to build gala
ERROR: Could not build wheels for gala, which is required to install pyproject.toml-based projects"

I am also getting repeated errors like this:

**_Warning: Package 'gala.tests' is absent from the packages configuration.
!!

          ********************************************************************************
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'gala.tests' as an importable package[^1],
          but it is absent from setuptools' `packages` configuration.

          This leads to an ambiguous overall configuration. If you want to distribute this
          package, please make sure that 'gala.tests' is explicitly added
          to the `packages` configuration field.

          Alternatively, you can also rely on setuptools' discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

          If you don't want 'gala.tests' to be distributed and are
          already explicitly excluding 'gala.tests' via
          `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
          you can try to use `exclude_package_data`, or `include-package-data=False` in
          combination with a more fine grained `package-data` configuration.

          You can read more about "package data files" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


          [^1]: For Python, any directory (with suitable naming) can be imported,
                even if it does not contain any `.py` files.
                On the other hand, currently there is no concept of package data
                directory, all directories are treated like packages.
          ********************************************************************************

  !!
    check.warn(importable)**

Not sure if this is something on my end or in gala!

@adrn
Copy link
Owner

adrn commented Aug 10, 2023

👋 Thanks for reporting this!

Ah, interesting. This might be a bug with the new packaging setup I'm using. Can you try installing from source:

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

@juliaespositon
Copy link
Author

Of course! I tried that out but am sadly still receiving the following error:

ERROR: Could not build wheels for gala, which is required to install pyproject.toml-based projects

Thanks for your help!

@adrn
Copy link
Owner

adrn commented Aug 10, 2023

Interesting -- this works for me on both MacOS 13.5 and on CentOS linux. What operating system are you on? What version of Python? And what version of pip?

python --version
pip --version

@juliaespositon
Copy link
Author

Hi! I've been testing out some other packages, too, and am realizing I'm getting similar errors so I'm wondering if it might not be a Gala thing! I'm on Windows 11 and python version 3.11.4 and pip version 23.2.1

@adrn
Copy link
Owner

adrn commented Aug 10, 2023

Ah, yes, Gala does not install on Windows because of the C compiler (MSVC), but what's confusing me is that the error you are getting sounds like it is a packaging error and not related to compilation. Hmm...

For others using Windows, I have recommended using the "Windows Subsystem for Linux" to install Gala.

@juliaespositon
Copy link
Author

I see!! Yeah, that is odd. It's also weird because I've had it installed for a couple years at an earlier version of Python so I'm not sure why now that I've updated things it's stopped working!!

I've used Windows Subsystem for Linux in the past and maybe can try that. Is there an alternative method I can also try related to the C compiler?

@adrn
Copy link
Owner

adrn commented Aug 10, 2023

I'll see if I can get the latest version of Gala to compile on Windows, but I've been unsuccessful in the past. I'll let you know after I take a look at this!

@juliaespositon
Copy link
Author

Hello again! I managed to get the download to work by downgrading my Python version in a new environment, but am now getting the following error.

`
ImportError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_10544\2443860891.py in
5 import astropy; from astropy.cosmology import Planck15 as cosmo; from astropy import units as u; from astropy.constants import G
6 import h5py; import requests; import re; from IPython.display import display, HTML; import seaborn as sns;
----> 7 import gala.integrate as gi; import gala.dynamics as gd; import gala.potential as gp; from gala.potential import scf
8 from gala import coordinates as co; from gala.units import galactic; import tarfile; import pingouin as pg; import itertools
9 import sympy as sy; from sympy import *; import random; import json; import emcee; import colossus

~\anaconda3\envs\galaenv\lib\site-packages\gala_init_.py in
27 if not ASTROPY_SETUP: # noqa
28 from . import coordinates
---> 29 from . import dynamics
30 from . import integrate
31 from . import potential

~\anaconda3\envs\galaenv\lib\site-packages\gala\dynamics_init_.py in
1 from .core import PhaseSpacePosition
2 from .orbit import Orbit
----> 3 from .analyticactionangle import *
4 from .actionangle import *
5 from .actionangle_staeckel import *

~\anaconda3\envs\galaenv\lib\site-packages\gala\dynamics\analyticactionangle.py in
11
12 # Project
---> 13 from ..potential import Hamiltonian, PotentialBase, IsochronePotential
14
15 all = ['isochrone_to_aa', 'harmonic_oscillator_to_aa']

~\anaconda3\envs\galaenv\lib\site-packages\gala\potential_init_.py in
----> 1 from .potential import *
2 from .hamiltonian import *
3 from .frame import *
4 from .scf import SCFPotential
5 from .common import PotentialParameter

~\anaconda3\envs\galaenv\lib\site-packages\gala\potential\potential_init_.py in
1 from .core import *
----> 2 from .cpotential import *
3 from .ccompositepotential import *
4 from .builtin import *
5 from .io import *

ImportError: DLL load failed: The specified module could not be found.
`

Not sure if you have seen this before or what could potentially be causing this. Thank you in advance!

@SlimakSlimak
Copy link

Hi, I am facing the same issue, is there any way to install the package on Windows?

@juliaespositon
Copy link
Author

@SlimakSlimak I got it to work by using Windows Subsystem for Linux! You can find a lot of tutorials on how to install it (eg. this one from Microsoft: https://learn.microsoft.com/en-us/windows/wsl/install). Then, you can pip install Gala in there (you have to run it through Ubuntu or something else - also weirdly, with WSL, I need to open up the Ubuntu notebook first every time I open my computer before opening my Anaconda (Windows) otherwise it doesn't work).

It worked for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants