簡體   English   中英

在沒有管理員權限的 Windows 上安裝 python 模塊

[英]Install python modules on windows without admin rights

我的工作筆記本電腦沒有管理員權限。 我的機器上安裝了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,所以我不想繼續請求管理員權限,也不想遇到任何麻煩,因為我試圖做一些不應該被實驗的事情我的筆記本電腦。

任何幫助是極大的贊賞。

該帖子已有 7 個月的歷史,但這可以幫助其他人。 這在沒有管理員權限的 Windows 10 Pro 上對我有用:python.exe -m pip install

  1. 安裝 Anaconda(不需要管理員權限)->
  2. 打開 Spyder ->
  3. 轉到終端並輸入 ->
import sys

!{sys.executable} -m pip install pandas

我在 Jupiter 筆記本上嘗試過,效果很好:

代碼:

import sys

!{sys.executable} -m pip install xarray

系統回復:

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:\anaconda3\lib\site-packages (from xarray) (41.0.1)
Requirement already satisfied: numpy>=1.15 in c:\anaconda3\lib\site-packages (from xarray) (1.16.4)
Requirement already satisfied: pandas>=0.25 in c:\anaconda3\lib\site-packages (from xarray) (1.2.1)
Requirement already satisfied: pytz>=2017.3 in c:\anaconda3\lib\site-packages (from pandas>=0.25->xarray) (2019.1)
Requirement already satisfied: python-dateutil>=2.7.3 in c:\anaconda3\lib\site-packages (from pandas>=0.25->xarray) (2.8.0)
Requirement already satisfied: six>=1.5 in c:\anaconda3\lib\site-packages (from python-dateutil>=2.7.3->pandas>=0.25->xarray) (1.12.0)
Installing collected packages: xarray
Successfully installed xarray-0.16.2

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM