Skip to content

Cannot import after installing from pip - find_packages error? #1

@robintw

Description

@robintw

After the recent upgrade to TinyDB 3.0, I've tried to install this module so that my custom serializers still work. Unfortunately, after installing via pip install tinydb-serialization I cannot import the module:

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

I think the reason behind this is that the module isn't actually being installed properly. Looking at the setup.py file, it uses find_packages() to list the packages that must be installed. In this case, the single source file (tinydb_serialization.py) is not a package, so isn't found by find_packages().

I thought it was better to raise an issue rather than submit a PR, as there are multiple ways to fix this. Possibly the best way is to move the source file into a proper package, but that may require changes in the way that the module is imported.

I think my analysis is correct - apologies if not!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions