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

FlowSOM directory name and pip installs #7

Closed
wants to merge 1 commit into from

Conversation

TarikExner
Copy link

Hey,

I tried to install FlowSOM on WSL2 and Linux using the command as specified in the readme.

pip install git+https://github.com/saeyslab/FlowSOM_Python

However, this lead to an import error after

python -c "import flowsom"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'flowsom'

Notably, installing on Windows and macOS via conda and mamba into a fresh environment works as intended.

Following this, I noticed that after cloning the repo, --editable pip installs would not work (Windows, WSL2, Linux, macOS), including the ones specified in the contributing guidelines:

pip install -e git+https://github.com/saeyslab/FlowSOM_Python#egg=flowsom
pip install -e ".[dev,test,doc]"
pip install -e .

while non-editable installs work as intended.

This import error is due to the fact that although a flowsom-0.0.1.dist-info is added to the site-packages directory, no actual flowsom directory is created for the scenarios described above. I tried a lot, including trying to change pyproject.toml in various ways so that the directory name can stay the same. Unfortunately, no success on that front.

The PR renames the FlowSOM directory to lowercase, which fixes all of the issues mentioned.

Reproducible example on WSL2/Linux:

conda create -n flowsom python=3.10
conda activate flowsom
pip install git+https://github.com/saeyslab/FlowSOM_Python
python -c "import flowsom" # leads to import error
pip install git+https://github.com/TarikExner/FlowSOM_Python@pip_issue --force-reinstall
python -c "import flowsom; print(flowsom.models.FlowSOMEstimator)"

If there is a way to keep the namespaces as they are, I would be happy to contribute to a different fix.

Do you think this change is appropriate or was there additional reasoning behind the naming and it's therefore better to look for a different fix?

Let me know!

Best,
Tarik

@TarikExner
Copy link
Author

Maybe as an additional comment on this: This PR passes the test suite, while the last PR failed the test due to an import error. As github is using ubuntu, this reproduces the issue independently.

Best,
Tarik

@berombau
Copy link
Member

Hi Tarik,

This bug haunted me some months ago when we did the renaming. The problem was that MacOS filesystems are case-insensitive or preserving, instead of case-sensitive like Windows and Linux. My local setup had the correct lowercase folder name, but git could not pick up this change. We had this issue before because we tested it on different platforms, but somehow this slipped back in.

I updated it. I also wanted to mention that your git commits seem a bit off. The git config name and email differ maybe between the commit and author config, so they show up as two different profiles. I would expect a single profile. It depends on your git workflow, but maybe because of a configuration in your IDE or GitHub Desktop setup?
They also are not linked to your public GitHub profile, probably because your git config e-mail differs somewhere or the e-mail is not also added to your GitHub profile. If you fix this, I think you would for example show up as Contributor because of your previous commit, which is always nice :D

@berombau berombau closed this Apr 19, 2024
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

Successfully merging this pull request may close these issues.

2 participants