2

The program worked correctly, then when I tried to install the IMAPClient module I got an error:

sudo pip3 install IMAPClient

File "/usr/local/lib/python3.6/dist-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.6/dist-packages/run/__init__.py", line 
  121, in create_process
  shlex.split(command),
File "/usr/lib/python3.6/shlex.py", line 305, in split
  return list(lex)
File "/usr/lib/python3.6/shlex.py", line 295, in __next__
  token = self.get_token()
File "/usr/lib/python3.6/shlex.py", line 105, in get_token
  raw = self.read_token()
File "/usr/lib/python3.6/shlex.py", line 136, in read_token
  **strong text**nextchar = self.instream.read(1)
AttributeError: 'tuple' object has no attribute 'read'

I tried to reinstall pip, I also thought that there was a problem in some of the installed packages, if I try to display a list of packages, I get:

pip3 list
Package                  Version  
------------------------ ---------
apt-clone                0.2.1    
apturl                   0.5.2    
asn1crypto               0.24.0   
bcrypt                   3.1.4 
(some more packages).........

Really looking forward to advice, honestly searched the forum before asking.

Anoop Kumar
  • 845
  • 1
  • 8
  • 19
REO
  • 31
  • 5
  • Hi man, very weird, I managed to install IMAPClient on my local env with python3.6. Can you add the full `pip list` to your post please? – eladm26 Nov 14 '18 at 08:43
  • Thanks for the reaction, I kind of managed to fix it=) – REO Nov 14 '18 at 09:21

1 Answers1

0

Perhaps this is a stupid solution but it worked, I ended up using commands:

1)sudo apt-get purge python3-pip
2)deleted the pip folder in the "/usr/lib/python3/dist-packages/pip" directory

because the folder always remained, and if I re-installed the pip package, there was no effect

3) sudo easy_install pip

As a result, my pip earned and I was able to install the package, though I need to update the version.

$ pip3 -V

pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

But the reason for the breakdown, I did not determine. Thanks to everyone who took the time to solve this problem)

REO
  • 31
  • 5
  • Even i faced the same issue and mine was because of the `subprocess.run` module due to which even the `pip` was not working. So i deleted the `run` folder with https://stackoverflow.com/a/2501894/3057246 unlike deleting everyhting. – Vinod Srivastav Oct 19 '20 at 10:49