我在工作笔记本上没有管理员权限。我的机器上已安装了Python和pip,版本号如下:
C:\Users\banand\AppData\Local\Programs\Python\Python36\Scripts>python --version
Python 3.6.1
C:\Users\banand\AppData\Local\Programs\Python\Python36\Scripts>pip --version
pip 9.0.1 from c:\users\banand\appdata\local\programs\python\python36\lib\site-packages (python 3.6)
我需要一种利用在线可用的各种Python模块的方法。例如 - colorama
按照说明,我尝试了以下命令,但没有成功:
C:\Users\banand\AppData\Local\Programs\Python\Python36\Scripts>pip install colorama --user
Collecting colorama
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D431204F28>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',)': /simple/colorama/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D431204A58>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',)': /simple/colorama/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D431204780>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',)': /simple/colorama/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D431204BA8>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',)': /simple/colorama/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D431204898>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',)': /simple/colorama/
Could not find a version that satisfies the requirement colorama (from versions: )
No matching distribution found for colorama
我认为这可能与以下事实有关 - a. 我没有管理员权限,或者 b. 我在防火墙后面,因此正在执行某种形式的拦截
我想找出确切的问题,然后回答这个问题 - 是否有一种方法可以规避这些限制,并有一个可重复的方法来安装Python模块。
请注意,我在使用公司笔记本电脑,并且出于兴趣学习Python,因此我不想去请求管理员权限,也不想因为尝试在我的笔记本电脑上做一些不应该尝试的事情而陷入麻烦。
非常感谢您的帮助。
pip install -U colorama-0.3.9-py2.py3-none-any.whl --user
命令进行安装吗?从你发布的日志来看,这似乎是某种连接问题,可能是由于Windows防火墙设置引起的。 - metatoaster--user
安装。您已经在%LocalAppData%
中拥有针对每个用户的安装,该安装应该已将其“Scripts”目录添加到PATH
中。--user
安装使用漫游%AppData%
目录,相应的“Scripts”目录不会添加到PATH
中。 - Eryk Sun