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

新手上路,请多包涵

我的工作笔记本电脑没有管理员权限。我的机器上安装了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 是出于兴趣,所以我不想继续申请管理员权限,也不想惹上任何麻烦,因为我试图做一些不应该在其上进行实验的事情我的笔记本电脑。

任何帮助是极大的赞赏。

原文由 Bharat Anand 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 994
2 个回答
  1. 安装 Anaconda(不需要管理员权限)->
  2. 打开 Spyder ->
  3. 转到终端并输入 -> “` import sys

!{sys.executable} -m pip install pandas

”`

原文由 Sukant Ranjan 发布,翻译遵循 CC BY-SA 4.0 许可协议

该帖子已有 7 个月大,但这可以帮助其他人。这在没有管理员权限的 Windows 10 Pro 上对我有用:python.exe -m pip install

原文由 Meziane 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题