本文目录一览:
- 1、安装python模块时报错如何解决
- 2、python安装失败是什么意思,怎么解决,电脑是win7系统,64位?
- 3、python库安装错误 in _error_catcher解决之镜像安装(转)非常好用
- 4、如何解决python安装启动报错
- 5、安装python出错2503怎么解决
安装python模块时报错如何解决
前言:
这几天把python版本升级后,发现pip安装模块好多都报错(暂不确定是不是因为升级导致的),我定睛一看,发现是权限的问题,那么怎么解决呢?
1 权限问题
C:\Users\ljfpip install xlwt
Exception:
Traceback (most recent call last):
File "c:\program files\python35\lib\site-packages\pip\basecommand.py", line 21
1, in main
status = self.run(options, args)
File "c:\program files\python35\lib\site-packages\pip\commands\install.py", li
ne 311, in run
root=options.root_path,
File "c:\program files\python35\lib\site-packages\pip\req\req_set.py", line 64
6, in install **kwargs
File "c:\program files\python35\lib\site-packages\pip\req\req_install.py", lin
e 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "c:\program files\python35\lib\site-packages\pip\req\req_install.py", lin
e 998, in move_wheel_files
isolated=self.isolated,
File "c:\program files\python35\lib\site-packages\pip\wheel.py", line 339, inmove_wheel_files
clobber(source, lib_dir, True)
File "c:\program files\python35\lib\site-packages\pip\wheel.py", line 310, inclobber
ensure_dir(destdir)
File "c:\program files\python35\lib\site-packages\pip\utils\__init__.py", line 71, in ensure_dir
os.makedirs(path)
File "c:\program files\python35\lib\os.py", line 241, in makedirs
mkdir(name, mode)PermissionError: [WinError 5] 拒绝访问。: 'c:\\program files\\python35\\Lib\\sit
e-packages\\xlwt'
注意看我标红的那部分,提示说权限错误,拒绝访问,我们这样解决:
1 首先切换到c:\\program files\\目录下,
2 我们鼠标右击python35这个目录,点击 属性 ,
3 首先切换到 安全 这个大标题下面,选中当前登陆的用户,然后再点击编辑,编辑完以后不要忘记点击应用,
4 点击添加的权限,我这里为了方便全部一块选了,反正根据自己的实际情况而定,最后点击应用,再点击确定就大功告成。
5 我们此时再看看自己pip,是不是能够安装模块了。
python安装失败是什么意思,怎么解决,电脑是win7系统,64位?
【python安装】错误——“User installations are disabled via policy on the machine”
解决方法一:
1、在运行里输入gpedit.msc;
2、计算机配置管理管理模板windows组件windows Installer禁止用户安装;
3、打开它禁用此项就可以了。
若方法一不行,请使用方法二:、
1、进入注册表目录:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer
2、将 DisableUserInstalls 的值改为 0再安装即可
python库安装错误 in _error_catcher解决之镜像安装(转)非常好用
pip install grpcio-tools
1、出现如下错误:
Traceback (most recent call last):
File "d:\usedtool\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 302, in _error_catcher
yield
File "d:\usedtool\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 384, in read
data = self._fp.read(amt)
File "d:\usedtool\python\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 60, in read
data = self.__fp.read(amt)
File "d:\usedtool\python\lib\http\client.py", line 449, in read
n = self.readinto(b)
File "d:\usedtool\python\lib\http\client.py", line 493, in readinto
n = self.fp.readinto(b)
File "d:\usedtool\python\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "d:\usedtool\python\lib\ssl.py", line 1009, in recv_into
return self.read(nbytes, buffer)
File "d:\usedtool\python\lib\ssl.py", line 871, in read
return self._sslobj.read(len, buffer)
File "d:\usedtool\python\lib\ssl.py", line 631, in read
v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\usedtool\python\lib\site-packages\pip\_internal\basecommand.py", line 228, in main
status = self.run(options, args)
File "d:\usedtool\python\lib\site-packages\pip\_internal\commands\install.py", line 291, in run
resolver.resolve(requirement_set)
File "d:\usedtool\python\lib\site-packages\pip\_internal\resolve.py", line 103, in resolve
self._resolve_one(requirement_set, req)
File "d:\usedtool\python\lib\site-packages\pip\_internal\resolve.py", line 257, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "d:\usedtool\python\lib\site-packages\pip\_internal\resolve.py", line 210, in _get_abstract_dist_for
self.require_hashes
File "d:\usedtool\python\lib\site-packages\pip\_internal\operations\prepare.py", line 310, in prepare_linked_requirement
progress_bar=self.progress_bar
File "d:\usedtool\python\lib\site-packages\pip\_internal\download.py", line 837, in unpack_url
progress_bar=progress_bar
File "d:\usedtool\python\lib\site-packages\pip\_internal\download.py", line 674, in unpack_http_url
progress_bar)
File "d:\usedtool\python\lib\site-packages\pip\_internal\download.py", line 898, in _download_http_url
_download_url(resp, link, content_file, hashes, progress_bar)
File "d:\usedtool\python\lib\site-packages\pip\_internal\download.py", line 618, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "d:\usedtool\python\lib\site-packages\pip\_internal\utils\hashes.py", line 48, in check_against_chunks
for chunk in chunks:
File "d:\usedtool\python\lib\site-packages\pip\_internal\download.py", line 586, in written_chunks
for chunk in chunks:
File "d:\usedtool\python\lib\site-packages\pip\_internal\utils\ui.py", line 159, in iter
for x in it:
File "d:\usedtool\python\lib\site-packages\pip\_internal\download.py", line 575, in resp_read
decode_content=False):
File "d:\usedtool\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 436, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "d:\usedtool\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 401, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "d:\usedtool\python\lib\contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "d:\usedtool\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 307, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
解决方案:pip install grpcio-tools -i
后面的-i 即是镜像
---------------------
原文: ( 侵删,感谢! )
如何解决python安装启动报错
解决python安装启动报错的方法:
打开系统的环境变量path,将python的安装路径添加进去,然后确定,重新启动python就可以了
示例如下:
更多Python知识,请关注:Python自学网!!
安装python出错2503怎么解决
第一种解决方法:
原因就是C:WindowsTemp文件夹NTFS权限错误,将它的user权限改为完全控制就OK了。
第二种解决方法:管理员命令行安装
复制安装包到c盘
1.运行CMD(以管理员权限运行)
2.进入c盘根目录
3.输入以下命令:msiexec /package "c:python-2.7.13.amd64.msi"
python学习网,免费的在线学习python平台,欢迎关注!