I am going completely mental as I fail to understand and keep my python environment running.
So :
- I have a python environment running under Miniconda 3 and that I manage through an environment.yaml file
- Environment is used to develop within VSCode
- It installs a bunch of external package through conda and then installs my local development package in editable mode (simplified version of the environment.yaml)
name: DLL_ETL
channels:
- conda-forge
- msys2
- defaults
dependencies:
- pandas
- numpy
- pip:
- -e .
- datatable
- I update it regularly through "mamba env update"
However, since today this is what I see :
- Pip states that the package install is sucessful
- In the environment, when running Python from the command line, I can import my package
- Package is installed pointing to the correct location (a one-drive)
- When opening up an interactive window in VSCode with that environment as kernel : package cannot be found

What am I doing wrong?
What I tried :
- Deleting the environment and reinstalling from scratch
- Deleting the pycache and dll.egg-info
- Manually removing and installing again through pip (and not through mamba, even if it runs pip underneath).
- conda list shows the package as properly installed
As can be understood :
- Yes I am running a virtual environment
- Yes I am in the correct directory (especially when updating through environment.yaml)
- Even when manually installing
- Yes the directory with my local install is in my Python path and python is running

I managed to find the solution, but no idea why. I found a comment somewhere (I believe : pip: module installed as editable not found) that there is an issue in how some files are created when installing as editable.
More specifically, when installing as editable, two files are created :
- ___editable___dll_etl_1_0_0_finder.py
- editable.dll_etl-1.0.0.pth
both in the environment
Miniconda3\envs\DLL_ETL\Lib\site-packages
When comparing two environments I have, I noticed that the .pth created in the one that broke was not formatted similarly, the .py didn't even exist. More specifically
The original file

What it should look like

When creating the files manually, everything seems to work fine. I haven't tried to update since. Likely it's an issue with setuptools if I understand correctly.