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

python3 packages: at least some packages can't be used if installed via pkgman -H #10211

Open
OscarL opened this issue Mar 13, 2024 · 3 comments

Comments

@OscarL
Copy link
Contributor

OscarL commented Mar 13, 2024

Writing this one down before I forget.

At least some packages can't be used properly if installed via pkgman -H.

Example:

pkgman -H ./coverage_python310-7.4.3-1-x86_64.hpkg, then:

> python3 -c "import coverage"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'coverage'

and trying to run coverage:

> coverage
Traceback (most recent call last):
  File "/boot/home/config/bin/coverage", line 33, in <module>
    sys.exit(load_entry_point('coverage==7.4.3', 'console_scripts', 'coverage')())
  File "/boot/home/config/bin/coverage", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/packages/python3.10-3.10.13-3/.self/lib/python3.10/importlib/metadata/__init__.py", line 969, in distribution
    return Distribution.from_name(distribution_name)
  File "/packages/python3.10-3.10.13-3/.self/lib/python3.10/importlib/metadata/__init__.py", line 548, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for coverage

For reference:

>>> import sysconfig, pprint
>>> sysconfig.get_scheme_names()
('haiku', 'haiku_home', 'haiku_user', 'haiku_vendor', 'nt', 'nt_user', 'osx_framework_user', 'posix_home', 'posix_prefix', 'posix_user')
>>> pprint.pprint(sysconfig.get_paths('haiku'))
{'data': '/packages/python3.10-3.10.13-3/.self/non-packaged',
 'include': '/packages/python3.10-3.10.13-3/.self/non-packaged/develop/headers/python3.10',
 'platlib': '/packages/python3.10-3.10.13-3/.self/non-packaged/lib/python3.10/site-packages',
 'platstdlib': '/packages/python3.10-3.10.13-3/.self/lib/python3.10',
 'purelib': '/packages/python3.10-3.10.13-3/.self/non-packaged/lib/python3.10/site-packages',
 'scripts': '/packages/python3.10-3.10.13-3/.self/non-packaged/bin',
 'stdlib': '/packages/python3.10-3.10.13-3/.self/lib/python3.10'}
>>> pprint.pprint(sysconfig.get_paths('haiku_home'))
{'data': '/packages/python3.10-3.10.13-3/.self',
 'include': '/packages/python3.10-3.10.13-3/.self/develop/headers/python',
 'platinclude': '/packages/python3.10-3.10.13-3/.self/develop/headers/python',
 'platlib': '/packages/python3.10-3.10.13-3/.self/lib/python',
 'platstdlib': '/packages/python3.10-3.10.13-3/.self/lib/python',
 'purelib': '/packages/python3.10-3.10.13-3/.self/lib/python',
 'scripts': '/packages/python3.10-3.10.13-3/.self/bin',
 'stdlib': '/packages/python3.10-3.10.13-3/.self/lib/python'}
>>> pprint.pprint(sysconfig.get_paths('haiku_user'))
{'data': '/boot/home/config/non-packaged',
 'include': '/boot/home/config/non-packaged/develop/headers/python3.10',
 'platlib': '/boot/home/config/non-packaged/lib/python3.10/site-packages',
 'platstdlib': '/boot/home/config/non-packaged/lib/python3.10',
 'purelib': '/boot/home/config/non-packaged/lib/python3.10/site-packages',
 'scripts': '/boot/home/config/non-packaged/bin',
 'stdlib': '/boot/home/config/non-packaged/lib/python3.10'}
>>> pprint.pprint(sysconfig.get_paths('haiku_vendor'))
{'data': '/packages/python3.10-3.10.13-3/.self',
 'include': '/packages/python3.10-3.10.13-3/.self/develop/headers/python3.10',
 'platlib': '/packages/python3.10-3.10.13-3/.self/lib/python3.10/vendor-packages',
 'platstdlib': '/packages/python3.10-3.10.13-3/.self/lib/python3.10',
 'purelib': '/packages/python3.10-3.10.13-3/.self/lib/python3.10/vendor-packages',
 'scripts': '/packages/python3.10-3.10.13-3/.self/bin',
 'stdlib': '/packages/python3.10-3.10.13-3/.self/lib/python3.10'}
>>> 
@OscarL
Copy link
Contributor Author

OscarL commented Mar 13, 2024

Just in case: installing coverage as system package does works properly.

@OscarL
Copy link
Contributor Author

OscarL commented Mar 13, 2024

installing packages via pip --user do work, AFAICT. (my usual go to is pip --user pyserial)

@OscarL
Copy link
Contributor Author

OscarL commented Mar 13, 2024

Those sysconfig.get_paths('haiku_home') paths DO look wrong thou (python vs python3.10).

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

No branches or pull requests

1 participant