dstndstn / tractor

The Tractor: measuring astronomical sources via probabilistic inference
Other
86 stars 24 forks source link

Cannot open tractor-sdss-synth.py #102

Open dampach opened 1 year ago

dampach commented 1 year ago

I just installed tractor and tried to open the example (tractor-sdss-synth.py ), but I get this error:

Traceback (most recent call last):
  File "test_tractor.py", line 8, in <module>
    from tractor import *
  File "/home/dampach/.local/lib/python3.7/site-packages/tractor/__init__.py", line 1, in <module>
    from .engine import *
  File "/home/dampach/.local/lib/python3.7/site-packages/tractor/engine.py", line 18, in <module>
    from tractor.utils import MultiParams, _isint, get_class_from_name
ImportError: cannot import name 'MultiParams' from 'tractor.utils' (/home/dampach/.local/lib/python3.7/site-packages/tractor/utils/__init__.py)
dstndstn commented 1 year ago

Can you please list all the commands you ran before this happened. Did you install it? Or are you running from a git checkout of the code? Because that error is coming from an installed version, but I still don't see what the problem is.

dampach commented 1 year ago

I tried installing it with both options

wget -O - https://raw.github.com/dstndstn/tractor/master/checkout.sh | bash

and then

make
python setup.py install

sorry if its a foolish question and thanks in advance.

dstndstn commented 1 year ago

That's reasonable... and then what's the python command you're running to run that test?

dampach commented 1 year ago
python examples/tractor-sdss-synth.py

just like the README.md says

dstndstn commented 1 year ago

Okay... I asked because the stack trace you sent above it starts with

Traceback (most recent call last):
  File "test_tractor.py", line 8, in <module>
    from tractor import *

Wait, something is weird.

It says it's trying to read from /home/dampach/.local/lib/python3.7/site-packages/tractor/utils/init.py

but there's... no such file in the tractor repository. There's a tractor/utils.py, but not a tractor/utils directory. Are you sure that that /home/dampach/.local/lib/python3.7/site-packages/tractor directory isn't from an old installation or something?

dampach commented 1 year ago

Yeah, Im sure it's not an old installation because I just started with Tractor. I just realized there is a folder named utils that have an empty __init__.py file. Maybe that´s why?

dstndstn commented 1 year ago

Exactly, that's the problem, but where did it come from?

dampach commented 1 year ago

I just don´t know xd. But I tried changing the name of this utils folder and looks like that was the problem, because now I get an error from astrometry

dstndstn commented 1 year ago

Hooray, a different error :)