error when "pip uninstall subprocess.run"
I'm now at python3.8, after installing this, there're some errors that I don't know how to fix, how can I uninstall this, and get back the default subprocess library.
when I do sudo pip uninstall subprocess.run, I get:
ERROR: Exception:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
status = self.run(options, args)
File "/usr/lib/python3.8/site-packages/pip/_internal/commands/uninstall.py", line 51, in run
session = self.get_default_session(options)
File "/usr/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 72, in get_default_session
self._session = self.enter_context(self._build_session(options))
File "/usr/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 77, in _build_session
session = PipSession(
File "/usr/lib/python3.8/site-packages/pip/_internal/network/session.py", line 240, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/lib/python3.8/site-packages/pip/_internal/network/session.py", line 133, in user_agent
zip(["name", "version", "id"], distro.linux_distribution()),
File "/usr/lib/python3.8/site-packages/distro.py", line 122, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File "/usr/lib/python3.8/site-packages/distro.py", line 677, in linux_distribution
self.version(),
File "/usr/lib/python3.8/site-packages/distro.py", line 737, in version
self.lsb_release_attr('release'),
File "/usr/lib/python3.8/site-packages/distro.py", line 899, in lsb_release_attr
return self._lsb_release_info.get(attribute, '')
File "/usr/lib/python3.8/site-packages/distro.py", line 552, in __get__
ret = obj.__dict__[self._fname] = self._f(obj)
File "/usr/lib/python3.8/site-packages/distro.py", line 1015, in _lsb_release_info
content = stdout.decode(sys.getfilesystemencoding()).splitlines()
AttributeError: 'std_output' object has no attribute 'decode'
I followed this to fix the AttributeError: 'tuple' object has no attribute 'read'
https://github.com/textioHQ/subprocess.run/commit/1905f256e69febf4110b2745f58fb1ad692ce17c
if I don't apply the above fix, I get this when pip uninstall subprocess.sun:
ERROR: Exception:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
status = self.run(options, args)
File "/usr/lib/python3.8/site-packages/pip/_internal/commands/uninstall.py", line 51, in run
session = self.get_default_session(options)
File "/usr/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 72, in get_default_session
self._session = self.enter_context(self._build_session(options))
File "/usr/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 77, in _build_session
session = PipSession(
File "/usr/lib/python3.8/site-packages/pip/_internal/network/session.py", line 240, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/lib/python3.8/site-packages/pip/_internal/network/session.py", line 133, in user_agent
zip(["name", "version", "id"], distro.linux_distribution()),
File "/usr/lib/python3.8/site-packages/distro.py", line 122, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File "/usr/lib/python3.8/site-packages/distro.py", line 677, in linux_distribution
self.version(),
File "/usr/lib/python3.8/site-packages/distro.py", line 737, in version
self.lsb_release_attr('release'),
File "/usr/lib/python3.8/site-packages/distro.py", line 899, in lsb_release_attr
return self._lsb_release_info.get(attribute, '')
File "/usr/lib/python3.8/site-packages/distro.py", line 552, in __get__
ret = obj.__dict__[self._fname] = self._f(obj)
File "/usr/lib/python3.8/site-packages/distro.py", line 1012, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/site-packages/run/__init__.py", line 147, in __new__
process = cls.create_process(command, stdin, cwd=cwd, env=env, shell=shell)
File "/usr/lib/python3.8/site-packages/run/__init__.py", line 122, in create_process
shlex.split(command),
File "/usr/lib/python3.8/shlex.py", line 311, in split
return list(lex)
File "/usr/lib/python3.8/shlex.py", line 300, in __next__
token = self.get_token()
File "/usr/lib/python3.8/shlex.py", line 109, in get_token
raw = self.read_token()
File "/usr/lib/python3.8/shlex.py", line 140, in read_token
nextchar = self.instream.read(1)
AttributeError: 'tuple' object has no attribute 'read'
Am facing the same exact issue. I was using the standard subprocess on 3.8 and my fate brought me on this page and i installed the subprocess.run and post which am having issues. Can't uninstall the same and revert back.
Further to fix the issue I have tried to re compile the python 3.8 and in the end got the following error.
ERROR: Exception: Traceback (most recent call last): File "/tmp/tmpd_i6lgbz/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 188, in main status = self.run(options, args) File "/tmp/tmpd_i6lgbz/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/commands/install.py", line 286, in run with self._build_session(options) as session: File "/tmp/tmpd_i6lgbz/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 101, in _build_session session = PipSession( File "/tmp/tmpd_i6lgbz/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/download.py", line 559, in init self.headers["User-Agent"] = user_agent() File "/tmp/tmpd_i6lgbz/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/download.py", line 144, in user_agent zip(["name", "version", "id"], distro.linux_distribution()), File "/tmp/tmpd_i6lgbz/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 122, in linux_distribution return _distro.linux_distribution(full_distribution_name) File "/tmp/tmpd_i6lgbz/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 677, in linux_distribution self.version(), File "/tmp/tmpd_i6lgbz/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 737, in version self.lsb_release_attr('release'), File "/tmp/tmpd_i6lgbz/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 899, in lsb_release_attr return self._lsb_release_info.get(attribute, '') File "/tmp/tmpd_i6lgbz/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 552, in get ret = obj.dict[self._fname] = self._f(obj) File "/tmp/tmpd_i6lgbz/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 1012, in _lsb_release_info stdout = subprocess.check_output(cmd, stderr=devnull) File "/home/d2d/Python-3.8.0/Lib/subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/local/lib/python3.8/site-packages/run/init.py", line 145, in new process = cls.create_process(command, stdin, cwd=cwd, env=env, shell=shell) File "/usr/local/lib/python3.8/site-packages/run/init.py", line 121, in create_process shlex.split(command), File "/home/d2d/Python-3.8.0/Lib/shlex.py", line 310, in split return list(lex) File "/home/d2d/Python-3.8.0/Lib/shlex.py", line 300, in next token = self.get_token() File "/home/d2d/Python-3.8.0/Lib/shlex.py", line 109, in get_token raw = self.read_token() File "/home/d2d/Python-3.8.0/Lib/shlex.py", line 140, in read_token nextchar = self.instream.read(1) AttributeError: 'tuple' object has no attribute 'read' Makefile:1196: recipe for target 'altinstall' failed make: *** [altinstall] Error 2