Package: python3-scalene
Version: 1.4.1-1
Severity: important
X-Debbugs-Cc: david.m.co...@gmail.com

Dear Maintainer,

Running scalene, either with the CLI command `scalene`, or `python3.10 -m
scalene`, or `python3.9 -m scalene`, causes this (or similiar) import error:

Traceback (most recent call last):
  File "/usr/bin/scalene", line 33, in <module>
    sys.exit(load_entry_point('scalene==1.4.1', 'console_scripts',
'scalene')())
  File "/usr/bin/scalene", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/scalene/__main__.py", line 4, in
<module>
    from scalene import scalene_profiler
  File "/usr/lib/python3/dist-packages/scalene/scalene_profiler.py", line 46,
in <module>
    from scalene.scalene_mapfile import ScaleneMapFile
  File "/usr/lib/python3/dist-packages/scalene/scalene_mapfile.py", line 6, in
<module>
    from scalene import get_line_atomic  # type: ignore
ImportError: cannot import name 'get_line_atomic' from 'scalene'
(/usr/lib/python3/dist-packages/scalene/__init__.py)

The problem is easily traced to the included get_line_atomic C extension
being installed to /usr/lib/scalene/lib, which is not on Python's search
path for modules.  Extension modules should be installed alongside their
pure-Python companions, in /usr/lib/python3/dist-packages (see: every other
Python package with a C extension.)

This also explains why the generated manpage is a duplicate of `python3 -h`.


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-0-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages python3-scalene depends on:
ii  libc6                2.36-4
ii  libgcc-s1            12.2.0-9
ii  libstdc++6           12.2.0-9
ii  python3              3.10.6-1
ii  python3-cloudpickle  2.0.0-1
ii  python3-numpy        1:1.21.5-1+b1
ii  python3-rich         12.4.4-1

Versions of packages python3-scalene recommends:
ii  python3-ipython  8.5.0-1
ii  python3-pynvml   11.515.75-1

python3-scalene suggests no packages.

-- no debconf information

Reply via email to