Skip to content

Conversation

@MarkKoz
Copy link

@MarkKoz MarkKoz commented Nov 4, 2023

I tried to install this package on Python 3.9 with pip 23.3.1 and setuptools 68.2.2. It incorrectly installs the package into the root site-packages directory (instead of within an h2p_parser subdirectory). The module is not importable when installed this way.

I don't really know why setuptools installs it that way, but the config seemed relatively complex for what this package needs. package_dir seems unnecessary since the package is in the root directory:

If your packages are not in the root of the repository or do not correspond exactly to the directory structure, you also need to configure package_dir:

(https://setuptools.pypa.io/en/latest/userguide/package_discovery.html)

@MarkKoz
Copy link
Author

MarkKoz commented Nov 4, 2023

Okay this doesn't seem to work — I was initially testing with the repo as the cwd, so I missed this:

>>> import h2p_parser
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Mark\Desktop\virtualenv\lib\site-packages\h2p_parser\__init__.py", line 20, in <module>
    from h2p_parser import data
ImportError: cannot import name 'data' from partially initialized module 'h2p_parser' (most likely due to a circular import) (C:\Users\Mark\Desktop\virtualenv\lib\site-packages\h2p_parser\__init__.py)

Not sure why this is a problem.

@MarkKoz MarkKoz force-pushed the main branch 2 times, most recently from e29b899 to 7f34e2a Compare November 4, 2023 18:40
@MarkKoz
Copy link
Author

MarkKoz commented Nov 4, 2023

Right, so I was only including the root package and not subpackages. Subpackages would have to be explicitly included when providing a list. So instead, I switched to find_packages.

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

Successfully merging this pull request may close these issues.

1 participant