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

Missing module anydbm when pip installing #796

Open
ArneBachmann opened this issue May 25, 2018 · 8 comments
Open

Missing module anydbm when pip installing #796

ArneBachmann opened this issue May 25, 2018 · 8 comments
Labels
status: awaiting-triage Issues and PRs awaiting investigation and relabelling.

Comments

@ArneBachmann
Copy link

ash@mini:~> sudo pip3 install proselint
Collecting proselint
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/1b/d2/2e6afa3f933a12bfb1eb588f1ec8c26f915935356d8a0e51b2e5c53bfd04/proselint-0.8.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "/tmp/pip-install-m2mb9_r1/proselint/proselint/tools.py", line 20, in <module>
        import dbm
      File "/usr/lib64/python3.4/_import_failed/dbm.py", line 17, in <module>
        to install it.""".format(__name__, package))
    ImportError: Module 'dbm' is not installed.
    Use:
      sudo zypper install python3-dbm
    to install it.
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-m2mb9_r1/proselint/setup.py", line 4, in <module>
        from proselint.version import __version__
      File "/tmp/pip-install-m2mb9_r1/proselint/proselint/__init__.py", line 2, in <module>
        from . import tools
      File "/tmp/pip-install-m2mb9_r1/proselint/proselint/tools.py", line 22, in <module>
        import anydbm as dbm
    ImportError: No module named 'anydbm'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-m2mb9_r1/proselint/
@ArneBachmann
Copy link
Author

ArneBachmann commented May 25, 2018

OK; the solution was written out and worked:
sudo zypper install python3-dbm
but still... can't that be made a pip dependency?

@joshmgrant
Copy link
Contributor

Definitely a good catch! What OS and Python version are you using?

@ArneBachmann
Copy link
Author

On opensuse
Zypper is the package manager

@joshmgrant
Copy link
Contributor

joshmgrant commented May 28, 2018

So based on some research, it looks like on some versions of openSUSE python3-dbm is missing even though it's a stock module that should be included with standard Python installations. Based on this you have a few options:

  1. Follow the provided advice and run sudo zypper install python3-dbm which will resolve this dependency issue
  2. Update your openSUSE to a newer version (if possible)
  3. Open a PR to add python3-dbm to the requirements.txt file directly. I can do this for you but it may not solve the issue on openSUSE.

Let me know what you think!

@ArneBachmann
Copy link
Author

  1. Yeah, the error message was already helpful and told me to sudo zypper install python3-dbm which worked fine. The fact that there is a message with a solution, however, makes me think why not have the solution in place, but this may really be a system maintainers choice (OpenSuse Python package maintainer decided to not includ ethe package?).
  2. I'm on 42.3 which is pretty new, just last week OpenSUSE 15 was released, which I won't install in the near future, but one could look into that.
  3. Could work, but could also be a very specific bugfix not working on all OSs. I think it' spossible to define optional requirements, or extra requirements in the setup.py or requirements.txt, which use special environment checks to conditionally add the requirement.

@joshmgrant
Copy link
Contributor

I think I like the idea of a conditional import based on the OS. I'm going to open a PR as the first crack at this.

@joshmgrant
Copy link
Contributor

#797

@joshmgrant
Copy link
Contributor

Huh, this is more complicated than I thought (see above PR @ArneBachmann)

@joshmgrant joshmgrant reopened this May 31, 2018
@Nytelife26 Nytelife26 added the status: awaiting-triage Issues and PRs awaiting investigation and relabelling. label May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting-triage Issues and PRs awaiting investigation and relabelling.
Projects
None yet
Development

No branches or pull requests

3 participants