abacusorg / abacusutils

Python code to interface with halo catalogs and other Abacus N-body data products

Home Page:https://abacusutils.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trouble import abacusnbody

schwartzw opened this issue · comments

Hi there,

I am trying to import abacusnbody into jupyter-notebook but am having troubles. When I run the command:

from abacusnbody.data.compaso_halo_catalog import CompaSOHaloCatalog"

I get an error message saying:

No module named 'abacusnbody.version'

In the error message I see it's trying to go to the abacusnbody directory where int.py is (which I 've checked I have) yet it won't install. I am very much not tech savvy, so this may be an easy fix. If so, I apologize for the waste of time but will still appreciate the help.

Best,
Weston

Sorry you're having trouble! Can you say a little more about your environment? Are you using conda or virtual environments? Is this on a cluster or a personal laptop? Are you able to run the import command outside of a Jupyter notebook?

The first thing I would try is to set up a clean environment (new conda/virtual environment), update pip (pip install -U pip), and then try installing abacusutils again: pip install -U abacusutils.

Also, I'm going to move this issue over to the abacusutils repo, since that's where the code is hosted.

I am working on a Windows desktop currently, running conda, along with trying to run this on a virtual Linux machine. I believe this is a cluster, but to run the virtual machine I am on my personal laptop. I tried running the import command in Linux, but to no avail.

Also, I tried updating pip but that didn't work, so instead I am using the 'python3 -m pip install' command

abacusutils will only work on Linux; to run Linux software on Windows, the most reliable way these days is to use WSL: https://learn.microsoft.com/en-us/windows/wsl/install. I use WSL myself, and abacusutils works fine. (It should work regardless of whether you're in a virtual machine or in WSL, but if you're open to using WSL, I would try that first.)

If you still can't get it to work, can you copy and paste the exact commands you're running and their output, starting from a new conda environment?

@schwartzw It sounds like you're able to import abacusnbody now; can I go ahead and close this issue?

Yes you can. Sorry, I forgot to come back to let you know it started working