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

ModuleNotFoundError: No module named 'graph' // multiple notebook issue #426

Closed
nllz opened this issue Mar 1, 2021 · 1 comment
Closed
Labels
Milestone

Comments

@nllz
Copy link
Contributor

nllz commented Mar 1, 2021

Several notebooks, such as notebooks/InteractionNetwork.ipynb, rely on:

import bigbang.graph as graph

but

----> 6 import graph

fails with:

ModuleNotFoundError: No module named 'graph'

@nllz nllz added the bug label Mar 1, 2021
@sbenthall sbenthall added this to the 0.2.1 milestone Mar 2, 2021
@sbenthall
Copy link
Collaborator

Ok. I've figured this out.

Recall the earlier problem with sudo. That had to do with one command that for some reason is not in the conda installation, but remains in the pip installation.

python setup.py develop installs the package into the environment locally with hooks so that when you edit the source code in the development directory, it changes the Python environment.

A complication with this is that by default, it installs this into a root package. To avoid this, you can install in a user's directory.

python setup.py develop --user

See discussion here.

Note that there is a conda develop command that is supposed to do the same thing, but the consensus is it is not well documented or maintained.

pip install -e . is supposed to do the same thing as python setup.py develop. We do include this line in the requirements, but for some reason it is not working.

https://github.com/datactive/bigbang/blob/master/requirements.txt#L1

Reasons might be:

  • it should be after the other requirements
  • it should not be in the requirements file but should stand alone as an additional command

Note also that when I tried this, I got an error with the Levenshtein package installation, which is resolved by installing the development version of Python. See here.

A tricky thing about this is that we have been providing installation instructions assuming that somebody is installing it to develop the software. That is a different use case from somebody who wants to install it to use it for analysis. Ideally, there would be two instruction sets. Of course, at this stage we don't have many pure "users" ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants