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

Problem in the Installation of CellBender #93

Closed
danielbarhanin opened this issue Mar 26, 2021 · 6 comments
Closed

Problem in the Installation of CellBender #93

danielbarhanin opened this issue Mar 26, 2021 · 6 comments
Assignees

Comments

@danielbarhanin
Copy link

danielbarhanin commented Mar 26, 2021

Hey!
Following the instrucation for installing CellBender, I got this following error:
ERROR: CellBender is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).

This happens when i did the command:
pip install -e CellBender

So i tried to install the package like it's instructed above with this command:
pip install git+https://github.com/broadinstitute/CellBender.git

But when I tried to run cellbender remove-background I get the following error:
Traceback (most recent call last):
File "/usr/local/bin/cellbender", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/cellbender/base_cli.py", line 90, in main
parser = get_populated_argparser()
File "/usr/local/lib/python3.7/site-packages/cellbender/base_cli.py", line 76, in get_populated_argparser
module_argparse = importlib.import_module('.'.join(module_argparse_str_list))
File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 953, in _find_and_load_unlocked
File "", line 219, in _call_with_frames_removed
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'cellbender.remove_background'

Is there a solution for that? or new instructions for the installation?

Thanks in advance!

@sjfleming
Copy link
Member

I think the problem is likely that pip install -e CellBender might not be pointing to your local cloned repository.

Can you try the following?

git clone https://github.com/broadinstitute/CellBender.git CellBender

then double-check that when you do

ls CellBender

you should be able to see the file setup.py in that directory. If you can see that file, then

pip install -e CellBender

should work.

Alternatively, you can navigate into the directory where CellBender's setup.py file is located, and then do

pip install -e .

@sjfleming sjfleming self-assigned this Apr 1, 2021
@bbimber
Copy link

bbimber commented Feb 7, 2022

@sjfleming We're also interested in this. Is there any reason why we should need to clone the repo and do a local install, as opposed to:

pip install git+https://github.com/broadinstitute/CellBender.git

The latter would be much nicer since package could declare a dependency on the github URL, as opposed to manually cloning and installing. I would have guessed that the pip install command above basically does a clone/install anyway.

Do you know a reason the command above would not work?

@bbimber
Copy link

bbimber commented Feb 7, 2022

A couple other observations:

If I manually clone the repo, do 'pip install -e', and then delete the local git copy, the tool fails. I would have expected pip install to copy the relevant code into a python library folder - is this not the case?

@mxposed
Copy link
Contributor

mxposed commented Feb 16, 2022

@sjfleming please merge this #118 this would fix the issue

@sjfleming
Copy link
Member

Thanks @mxposed , I will get that merged in before too long.

@bbimber , I think @mxposed 's PR will fix your first comment. As for the other observation, I think that is actually expected behavior based on the -e flag I have included. -e installs in an editable mode. I like this because I like to make edits, but it's true that it doesn't always make sense. :)
If you install without the -e, then it should (?) continue to work after you delete the local git repo.

@sjfleming sjfleming mentioned this issue Mar 28, 2023
@sjfleming sjfleming mentioned this issue Aug 6, 2023
@sjfleming
Copy link
Member

Closed by #238

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

No branches or pull requests

4 participants