在没有管理员权限的情况下在windows上安装python模块



我的工作笔记本电脑没有管理员权限。我的机器上安装了python和pip,版本号如下:

C:UsersbanandAppDataLocalProgramsPythonPython36Scripts>python --version
Python 3.6.1
C:UsersbanandAppDataLocalProgramsPythonPython36Scripts>pip --version
pip 9.0.1 from c:usersbanandappdatalocalprogramspythonpython36libsite-packages (python 3.6)

我需要一种方法来利用各种在线可用的python模块。一个例子是-colorama

根据说明,我尝试了以下命令,但没有成功:

C:UsersbanandAppDataLocalProgramsPythonPython36Scripts>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,所以我不想继续请求管理员权限,也不想因为我试图做一些不应该在我的笔记本电脑上进行实验的事情而陷入任何麻烦。

非常感谢您的帮助。

这篇文章已经发布了7个月,但这可以帮助其他人。这在没有管理员权限的Windows 10 Pro上对我有效:python.exe-m pip安装

  1. 安装Anaconda(不需要管理员权限(->
  2. 打开Spyder->
  3. 转到终端并键入->
import sys
!{sys.executable} -m pip install pandas

我在Jupiter笔记本上试过了,效果很好:

代码:

import sys
!{sys.executable} -m pip install xarray

sysmtem答案:

Collecting xarray
Using cached https://files.pythonhosted.org/packages/10/6f/9aa15b1f9001593d51a0e417a8ad2127ef384d08129a0720b3599133c1ed/xarray-0.16.2-py3-none-any.whl
Requirement already satisfied: setuptools>=38.4 in c:anaconda3libsite-packages (from xarray) (41.0.1)
Requirement already satisfied: numpy>=1.15 in c:anaconda3libsite-packages (from xarray) (1.16.4)
Requirement already satisfied: pandas>=0.25 in c:anaconda3libsite-packages (from xarray) (1.2.1)
Requirement already satisfied: pytz>=2017.3 in c:anaconda3libsite-packages (from pandas>=0.25->xarray) (2019.1)
Requirement already satisfied: python-dateutil>=2.7.3 in c:anaconda3libsite-packages (from pandas>=0.25->xarray) (2.8.0)
Requirement already satisfied: six>=1.5 in c:anaconda3libsite-packages (from python-dateutil>=2.7.3->pandas>=0.25->xarray) (1.12.0)
Installing collected packages: xarray
Successfully installed xarray-0.16.2

相关内容

  • 没有找到相关文章

最新更新