Closed blychs closed 2 months ago
@blychs what is your pip version?
I just tried with a new env, which got pip 24.2 and setuptools 73.0.1, and had no issue.
pip 22.0 mamba 1.5.8 conda 24.5.0
I did use mamba to create the environment and install the initial packages, but as far as I'm aware, mamba is wrapping conda, and since this packages are installed with pip, that shouldn't make a difference
What is the setuptools version in your env?
setuptools 70.0.0
Do you want to try removing all traces of the installed monetio (pip uninstall
+ checking none of those site-packages stuff remains), upgrading pip/setuptools with conda
/mamba
, and trying editable install again?
Hi Zach. I just created a new environment from scratch and still see the same problem (pip 24.2, setuptools 73.0.0). An important note: I don't get any problem if I am in the monetio directory, it gets imported well. But if I am anywhere else, this happens. I installed all of the environment with conda this time, to make sure mamba wasn't messing things up. I have no clue why this happened.
Just another note (which I assume by your answers that you got right, but just in case anyone else looks here), I am talking about the installation of the developer's branch as editable.
And what you did was run pip install --force-reinstall --no-deps --editable .
inside the root of the monetio repo? What messages do you get if you do, at the root of the monetio repo,
pip uninstall monetio && pip install --no-deps --editable .
(melodies-monet-testinstaller) plichtig@derecho7:~/melodies-monet-testinstaller> git clone git@github.com:noaa-oar-arl/monetio.git
Cloning into 'monetio'...
remote: Enumerating objects: 4108, done.
remote: Counting objects: 100% (1546/1546), done.
remote: Compressing objects: 100% (395/395), done.
remote: Total 4108 (delta 1231), reused 1169 (delta 1151), pack-reused 2562 (from 1)
Receiving objects: 100% (4108/4108), 11.40 MiB | 9.36 MiB/s, done.
Resolving deltas: 100% (2792/2792), done.
(melodies-monet-testinstaller) plichtig@derecho7:~/melodies-monet-testinstaller> cd monetio
(melodies-monet-testinstaller) plichtig@derecho7:~/melodies-monet-testinstaller/monetio> git checkout develop
branch 'develop' set up to track 'origin/develop'.
Switched to a new branch 'develop'
(melodies-monet-testinstaller) plichtig@derecho7:~/melodies-monet-testinstaller/monetio> pip install --force-reinstall --no-deps --editable .
Obtaining file:///glade/u/home/plichtig/melodies-monet-testinstaller/monetio
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... done
Preparing editable metadata (pyproject.toml) ... done
Building wheels for collected packages: monetio
Building editable for monetio (pyproject.toml) ... done
Created wheel for monetio: filename=monetio-0.2.6-0.editable-py3-none-any.whl size=4395 sha256=ab463723669254b6cd3cb7e62e7d153e36e7fb9ec63994624597e6fcb65706dc
Stored in directory: /glade/derecho/scratch/plichtig/tmp/pip-ephem-wheel-cache-ypblguny/wheels/c1/fc/00/31f98fae183b3f9baa141db8f257570414c83564277ed00eb9
Successfully built monetio
Installing collected packages: monetio
Attempting uninstall: monetio
Found existing installation: monetio 0.2.6
Uninstalling monetio-0.2.6:
Successfully uninstalled monetio-0.2.6
Successfully installed monetio-0.2.6
However, I logged out from the system (I do everything in NCAR's hpc system), logged back in again and now it seems to be working, which makes me even more confused. I'll keep testing and let you know what goes on. I think that we could close this issue, and I'll reopen it if I get any new input. I am extremely confused by it, and it might just have been a sum of bad luck. However, I started testing this because a coworker had had this same issue. She had it both in her desktop computer and in NCAR's HPC system.
When monetio is installed as suggested by the docs in MELODIES-MONET, using pip, it goes for the wrong path. I. e., it is looking for the base directory monetio instead of monetio/monetio. Therefore, it does not find the
__init__.py
, and the only solution seems to be to import monetio.monetio.After tinkering with it a bit, I was able to make it work (by comparing it with my installation of melodies-monet), but it required editing line 16 of /glade/work/plichtig/conda-envs/melodies-monet-test/lib/python3.11/site-packages/__editable___monet_2_2_10_finder.py
from
def find_spec(cls, fullname: str, path=None, target=None) -> ModuleSpec | None: # type: ignore
todef find_spec(cls, fullname: str, _path=None, _target=None) -> ModuleSpec | None: # type: ignore
and line 62 from
def find_spec(cls, fullname: str, target=None) -> ModuleSpec | None: # type: ignore
todef find_spec(cls, fullname: str, _target=None) -> ModuleSpec | None: # type: ignore
This seems to me as a bug with (my version of?) pip and/or conda.
maybe @dwfncar or @zmoon have some insight? Do we need to force some version of pip and/or conda?
I have no clue about why this problem showed up only now, considering I've been using this for a while. I did reinstall everything with pip though, while testing changing repos, but I don't think I updated anything else