[英]How to solve the problem with installing packages through pip3?
The program worked correctly, then when I tried to install the IMAPClient module I got an error: 该程序正常运行,然后当我尝试安装IMAPClient模块时出现错误:
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: 我尝试重新安装pip,我还认为某些已安装的软件包中存在问题,如果尝试显示软件包列表,则会得到:
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. 真的很希望提出建议,请在询问之前先诚实地搜索论坛。
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 因为该文件夹始终存在,并且如果我重新安装了pip软件包,则没有任何效果
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)
感谢所有花时间解决这个问题的人)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.