python-apt
python-apt copied to clipboard
AttributeError: 'module' object has no attribute 'split'
% 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.
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 "
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'
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.