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

Editable pip install is not working correctly #102

Open
maarten-ic opened this issue Aug 15, 2022 · 2 comments
Open

Editable pip install is not working correctly #102

maarten-ic opened this issue Aug 15, 2022 · 2 comments
Labels
documentation Improve the documentation good first issue Good for newcomers

Comments

@maarten-ic
Copy link
Collaborator

When following these instructions on the documentation, the package is installed through pip install -e .[dev].

Unfortunately, editable installs are not supported with a custom pkg_dir in setup.py. See for instance this ticket: pypa/pip#3160
Eventually you'll get ModuleNotFoundErrors like below:

$ muscle_manager --help
Traceback (most recent call last):
  File "/home/[...]/venv_muscle3/bin/muscle_manager", line 33, in <module>
    sys.exit(load_entry_point('muscle3', 'console_scripts', 'muscle_manager')())
  File "/home/[...]/venv_muscle3/bin/muscle_manager", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/[...]/projects/muscle3/muscle3/muscle_manager.py", line 10, in <module>
    from libmuscle.manager.manager import Manager
ModuleNotFoundError: No module named 'libmuscle.manager'

Suggested immediate fix: update documentation to not use pip install -e.

If I have better suggestions I'll update this issue.

@DaanVanVugt
Copy link
Collaborator

Relevant discussion at pypa/setuptools#230

@DaanVanVugt
Copy link
Collaborator

Adding the --use-pep517 flag to get pip install --use-pep517 -e .[dev] resolves the problem. I believe PEP517 is enabled by default when using pyproject.toml, so at that point the flag can be removed again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improve the documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants