• Python 使用


    #查看python安装位置

    C:Users密码123456>where python
    C:Program Filespythonpython.exe
    C:Users密码123456AppDataLocalMicrosoftWindowsAppspython.exe
    

    #查看已安装的库

    方法一:

    C:Users密码123456>pip list
    Package                   Version
    ------------------------- ---------
    aliyun-python-sdk-core    2.13.25
    aliyun-python-sdk-core-v3 2.13.11
    aliyun-python-sdk-kms     2.11.0
    

     方法二:

    C:Users密码123456> pip freeze
    aliyun-python-sdk-core==2.13.25
    aliyun-python-sdk-core-v3==2.13.11
    aliyun-python-sdk-kms==2.11.0
    

    #安装

    C:Program Filespython>python -m pip install numpy
    Defaulting to user installation because normal site-packages is not writeable
    Collecting numpy
      Downloading numpy-1.20.1-cp38-cp38-win_amd64.whl (13.7 MB)
         |███                             | 1.4 MB 8.9 kB/s eta 0:23:01
    

     或者

    D:chulaixipython>pip install numpy-1.20.1-cp38-cp38-win_amd64.whl
    Defaulting to user installation because normal site-packages is not writeable
    Processing d:chulaixipython
    umpy-1.20.1-cp38-cp38-win_amd64.whl
    Installing collected packages: numpy
      WARNING: The script f2py.exe is installed in 'C:Users密码123456AppDataRoamingPythonPython38Scripts' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Successfully installed numpy-1.20.1
    

    #安装示例

     torch安装

    D:chulaixipython>python -m pip install torch
    Defaulting to user installation because normal site-packages is not writeable
    Collecting torch
      Downloading torch-1.7.1-cp38-cp38-win_amd64.whl (184.0 MB)
         |████████████████████████████████| 184.0 MB 108 kB/s
    Collecting typing-extensions
      Downloading typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
    Requirement already satisfied: numpy in c:users密码123456appdata
    oamingpythonpython38site-packages (from torch) (1.20.1)
    Installing collected packages: typing-extensions, torch
      WARNING: The scripts convert-caffe2-to-onnx.exe and convert-onnx-to-caffe2.exe are installed in 'C:Users密码123456AppDataRoamingPythonPython38Scripts' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Successfully installed torch-1.7.1 typing-extensions-3.7.4.3
    

     opencv_python安装

    D:chulaixipython>python -m pip install opencv_python
    Defaulting to user installation because normal site-packages is not writeable
    Collecting opencv_python
      Downloading opencv_python-4.5.1.48-cp38-cp38-win_amd64.whl (34.9 MB)
         |████████████████████████████████| 34.9 MB 930 kB/s
    Requirement already satisfied: numpy>=1.17.3 in c:users密码123456appdata
    oamingpythonpython38site-packages (from opencv_python) (1.20.1)
    Installing collected packages: opencv-python
    Successfully installed opencv-python-4.5.1.48
    

     torchvision安装

    D:chulaixipython>python -m pip install torchvision
    Defaulting to user installation because normal site-packages is not writeable
    Collecting torchvision
      Downloading torchvision-0.5.0-cp38-cp38-win_amd64.whl (1.2 MB)
         |████████████████████████████████| 1.2 MB 7.0 kB/s
    Requirement already satisfied: pillow>=4.1.1 in c:program filespythonlibsite-packages (from torchvision) (7.2.0)
    Requirement already satisfied: numpy in c:users密码123456appdata
    oamingpythonpython38site-packages (from torchvision) (1.20.1)
      Downloading torchvision-0.2.2.post3-py2.py3-none-any.whl (64 kB)
         |████████████████████████████████| 64 kB 19 kB/s
    Requirement already satisfied: torch in c:users密码123456appdata
    oamingpythonpython38site-packages (from torchvision) (1.7.1)
    Requirement already satisfied: six in c:program filespythonlibsite-packages (from torchvision) (1.15.0)
    Requirement already satisfied: typing-extensions in c:users密码123456appdata
    oamingpythonpython38site-packages (from torch->torchvision) (3.7.4.3)
    Installing collected packages: torchvision
    Successfully installed torchvision-0.2.2.post3
    

     typing安装

    D:chulaixipython>python -m pip install typing
    Defaulting to user installation because normal site-packages is not writeable
    Collecting typing
      Downloading typing-3.7.4.3.tar.gz (78 kB)
         |████████████████████████████████| 78 kB 10 kB/s
    Using legacy 'setup.py install' for typing, since package 'wheel' is not installed.
    Installing collected packages: typing
        Running setup.py install for typing ... done
    Successfully installed typing-3.7.4.3
    

     torchstat安装

    D:chulaixipython>python -m pip install torchstat
    Defaulting to user installation because normal site-packages is not writeable
    Collecting torchstat
      Using cached torchstat-0.0.7-py3-none-any.whl (11 kB)
    Collecting pandas
      Downloading pandas-1.2.1-cp38-cp38-win_amd64.whl (9.3 MB)
         |████████████████████████████████| 9.3 MB 6.8 MB/s
    Requirement already satisfied: numpy in c:users密码123456appdata
    oamingpythonpython38site-packages (from torchstat) (1.20.1)
    Requirement already satisfied: torch in c:users密码123456appdata
    oamingpythonpython38site-packages (from torchstat) (1.7.1)
    Collecting python-dateutil>=2.7.3
      Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
         |████████████████████████████████| 227 kB ...
    Requirement already satisfied: pytz>=2017.3 in c:program filespythonlibsite-packages (from pandas->torchstat) (2020.1)
    Requirement already satisfied: six>=1.5 in c:program filespythonlibsite-packages (from python-dateutil>=2.7.3->pandas->torchstat) (1.15.0)
    Requirement already satisfied: typing-extensions in c:users密码123456appdata
    oamingpythonpython38site-packages (from torch->torchstat) (3.7.4.3)
    Installing collected packages: python-dateutil, pandas, torchstat
      WARNING: The script torchstat.exe is installed in 'C:Users密码123456AppDataRoamingPythonPython38Scripts' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Successfully installed pandas-1.2.1 python-dateutil-2.8.1 torchstat-0.0.7
    

    torchsummary安装

    D:chulaixipython>python -m pip install torchsummary
    Defaulting to user installation because normal site-packages is not writeable
    Collecting torchsummary
      Downloading torchsummary-1.5.1-py3-none-any.whl (2.8 kB)
    Installing collected packages: torchsummary
    Successfully installed torchsummary-1.5.1
    

    ptflops安装

    D:chulaixipython>python -m pip install ptflops
    Defaulting to user installation because normal site-packages is not writeable
    Collecting ptflops
      Downloading ptflops-0.6.4.tar.gz (10 kB)
    Requirement already satisfied: torch in c:users密码123456appdata
    oamingpythonpython38site-packages (from ptflops) (1.7.1)
    Requirement already satisfied: numpy in c:users密码123456appdata
    oamingpythonpython38site-packages (from torch->ptflops) (1.20.1)
    Requirement already satisfied: typing-extensions in c:users密码123456appdata
    oamingpythonpython38site-packages (from torch->ptflops) (3.7.4.3)
    Using legacy 'setup.py install' for ptflops, since package 'wheel' is not installed.
    Installing collected packages: ptflops
        Running setup.py install for ptflops ... done
    Successfully installed ptflops-0.6.4
    

    matplotlib安装

    D:chulaixipython>python -m pip install matplotlib
    Defaulting to user installation because normal site-packages is not writeable
    Collecting matplotlib
      Downloading matplotlib-3.3.4-cp38-cp38-win_amd64.whl (8.5 MB)
         |████████████████████████████████| 8.5 MB 3.3 MB/s
    Requirement already satisfied: pillow>=6.2.0 in c:program filespythonlibsite-packages (from matplotlib) (7.2.0)
    Collecting kiwisolver>=1.0.1
      Downloading kiwisolver-1.3.1-cp38-cp38-win_amd64.whl (51 kB)
         |████████████████████████████████| 51 kB 243 kB/s
    Requirement already satisfied: python-dateutil>=2.1 in c:users密码123456appdata
    oamingpythonpython38site-packages (from matplotlib) (2.8.1)
    Requirement already satisfied: numpy>=1.15 in c:users密码123456appdata
    oamingpythonpython38site-packages (from matplotlib) (1.20.1)
    Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in c:program filespythonlibsite-packages (from matplotlib) (2.4.7)
    Collecting cycler>=0.10
      Downloading cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
    Requirement already satisfied: six in c:program filespythonlibsite-packages (from cycler>=0.10->matplotlib) (1.15.0)
    Installing collected packages: kiwisolver, cycler, matplotlib
    Successfully installed cycler-0.10.0 kiwisolver-1.3.1 matplotlib-3.3.4
    

    onnx安装

    D:chulaixipython>python -m pip install onnx
    Defaulting to user installation because normal site-packages is not writeable
    Collecting onnx
      Downloading onnx-1.8.1-cp38-cp38-win_amd64.whl (6.9 MB)
         |████████████████████████████████| 6.9 MB 3.3 MB/s
    Requirement already satisfied: numpy>=1.16.6 in c:users密码123456appdata
    oamingpythonpython38site-packages (from onnx) (1.20.1)
    Requirement already satisfied: six in c:program filespythonlibsite-packages (from onnx) (1.15.0)
    Requirement already satisfied: typing-extensions>=3.6.2.1 in c:users密码123456appdata
    oamingpythonpython38site-packages (from onnx) (3.7.4.3)
    Requirement already satisfied: protobuf in c:program filespythonlibsite-packages (from onnx) (3.12.4)
    Requirement already satisfied: setuptools in c:program filespythonlibsite-packages (from protobuf->onnx) (49.2.1)
    Installing collected packages: onnx
      WARNING: The scripts backend-test-tools.exe, check-model.exe and check-node.exe are installed in 'C:Users密码123456AppDataRoamingPythonPython38Scripts' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Successfully installed onnx-1.8.1
    

    onnxruntime安装

    D:chulaixipython>python -m pip install onnxruntime
    Defaulting to user installation because normal site-packages is not writeable
    Collecting onnxruntime
      Downloading onnxruntime-1.6.0-cp38-cp38-win_amd64.whl (4.2 MB)
         |████████████████████████████████| 4.2 MB 1.1 MB/s
    Requirement already satisfied: numpy>=1.16.6 in c:users密码123456appdata
    oamingpythonpython38site-packages (from onnxruntime) (1.20.1)
    Requirement already satisfied: protobuf in c:program filespythonlibsite-packages (from onnxruntime) (3.12.4)
    Requirement already satisfied: setuptools in c:program filespythonlibsite-packages (from protobuf->onnxruntime) (49.2.1)
    Requirement already satisfied: six>=1.9 in c:program filespythonlibsite-packages (from protobuf->onnxruntime) (1.15.0)
    Installing collected packages: onnxruntime
      WARNING: The script onnxruntime_test.exe is installed in 'C:Users密码123456AppDataRoamingPythonPython38Scripts' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Successfully installed onnxruntime-1.6.0
    
  • 相关阅读:
    Educational Codeforces Round 58 A,B,C,D,E,G
    Codeforces Round #530 (Div. 2) F (树形dp+线段树)
    Codeforces Round #530 (Div. 2) A,B,C,D
    bzoj 3262: 陌上花开
    bzoj 2653: middle (主席树+二分)
    费马小定理的证明
    分组背包
    二维费用的背包问题
    luoguP1164 小A点菜(背包问题)
    完全背包问题
  • 原文地址:https://www.cnblogs.com/hakulamatata/p/14393322.html
Copyright © 2020-2023  润新知