python-apt icon indicating copy to clipboard operation
python-apt copied to clipboard

AttributeError: 'module' object has no attribute 'split'

Open SKelem opened this issue 9 years ago • 2 comments

% sudo pip3 install -U python-apt
Collecting python-apt
  Downloading python-apt-0.7.8.tar.bz2 (49kB)
    100% |████████████████████████████████| 53kB 1.2MB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-3wzlbss1/python-apt/setup.py", line 11, in <module>
        string.split(parse_makefile("python/makefile")["APT_PKG_SRC"]))
    AttributeError: 'module' object has no attribute 'split'

So, even though I'm using pip3, the deprecated string.split call is in the code.

SKelem avatar Oct 29 '15 00:10 SKelem

Same issue.

python3.6 -m pip install --no-cache-dir --upgrade python-apt Collecting python-apt Downloading python-apt-0.7.8.tar.bz2 (49kB) 100% |████████████████████████████████| 51kB 1.1MB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-9m66q1f7/python-apt/setup.py", line 11, in string.split(parse_makefile("python/makefile")["APT_PKG_SRC"])) AttributeError: module 'string' has no attribute 'split' Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in from apport.report import Report File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in import apport.fileutils File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in from apport.packaging_impl import impl as packaging File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in import apt File "/tmp/pip-build-9m66q1f7/python-apt/apt/init.py", line 2, in import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-9m66q1f7/python-apt/setup.py", line 11, in <module>
    string.split(parse_makefile("python/makefile")["APT_PKG_SRC"]))
AttributeError: module 'string' has no attribute 'split'

pseudotensor avatar Jun 07 '17 19:06 pseudotensor

FWIW and because Googling the error leads here, this was fixed¹ back in 2009 in the real python-apt package, but you simply can't upgrade python-apt with pip.

The issue is that the python-apt release on PyPI is stuck at version 0.7.8 for all eternity, and nobody cares. This situation will endure until someone with proper access to PyPI either updates or un-publishes python-apt.

¹ The string.split function exists in Python 2.x but not in Python 3.x, where it is only available as an instance method of the str class. This made version 0.7.8 of python-apt incompatible with then-new Python 3. The release of 0.7.9 fixed that back in March 2009, unfortunately PyPI stayed behind as explained above.

domq avatar Sep 17 '17 08:09 domq