admin 管理员组

文章数量: 887016

很多问题都是pip版本太低造成的,所以在往下做之前,可以先升级一下pip为最新版本:

python -m pip install -U pip

 

 

二、联网下载库

1. 导出库信息

pip freeze > requirements.txt

这个命令是将已经通过pip安装的包的名称记录到requirements.txt文件中。

导出这个文件后,编辑文件,留下你需要的库,其他删除。

 

2. 下载库安装包

pip download D:\packages -r requirements.txt

注意:win10有可能因为写入权限的问题导致无法操作成功,可以直接进入目标文件夹然后执行:pip download -r requirements.txt

将requirements.txt中列出来的库下载到packages文件夹。

这里要注意,因为我的pip版本比较新,所以用的download,据说老一点的版本应该是install --download:

pip install --download D:\packages -r requirements.txt

注意:如果requirements.txt里面存在不能通过pip安装的库,下载过程会报错。

 

 

三、离线安装库

将requirements.txt和packages文件夹拷贝到需要离线安装的电脑,通过以下命令进行安装:

pip install --no-index --find-links=D:\packages -r requirements.txt

根据pip版本不同,里面的参数有可能是--find-link。

 

以下是我神奇的奇葩经历,python坑比较多,这还没用多久,就发现几个坑

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>pip download e:\ cx-oracle
Directory 'e:\\' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.

C:\Users\Administrator>pip download e:\ cx_oracle
Directory 'e:\\' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.

C:\Users\Administrator>pip download e:\ cx_oracle
Directory 'e:\\' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.

C:\Users\Administrator>python -v
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'nt' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import 'winreg' # <class '_frozen_importlib.BuiltinImporter'>
# E:\Python\Python37-32\lib\encodings\__pycache__\__init__.cpython-37.pyc matches E:\Python\Python37-32\lib\enc
odings\__init__.py
# code object from 'E:\\Python\\Python37-32\\lib\\encodings\\__pycache__\\__init__.cpython-37.pyc'
# E:\Python\Python37-32\lib\__pycache__\codecs.cpython-37.pyc matches E:\Python\Python37-32\lib\codecs.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\codecs.cpython-37.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x00298F90>
# E:\Python\Python37-32\lib\encodings\__pycache__\aliases.cpython-37.pyc matches E:\Python\Python37-32\lib\enco
dings\aliases.py
# code object from 'E:\\Python\\Python37-32\\lib\\encodings\\__pycache__\\aliases.cpython-37.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x002B11D0>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x00298850>
# E:\Python\Python37-32\lib\encodings\__pycache__\utf_8.cpython-37.pyc matches E:\Python\Python37-32\lib\encodi
ngs\utf_8.py
# code object from 'E:\\Python\\Python37-32\\lib\\encodings\\__pycache__\\utf_8.cpython-37.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x002BD070>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# E:\Python\Python37-32\lib\encodings\__pycache__\latin_1.cpython-37.pyc matches E:\Python\Python37-32\lib\enco
dings\latin_1.py
# code object from 'E:\\Python\\Python37-32\\lib\\encodings\\__pycache__\\latin_1.cpython-37.pyc'
import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader object at 0x002BD2B0>
# E:\Python\Python37-32\lib\__pycache__\io.cpython-37.pyc matches E:\Python\Python37-32\lib\io.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\io.cpython-37.pyc'
# E:\Python\Python37-32\lib\__pycache__\abc.cpython-37.pyc matches E:\Python\Python37-32\lib\abc.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\abc.cpython-37.pyc'
import '_abc' # <class '_frozen_importlib.BuiltinImporter'>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x002BD4F0>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x002BD350>
# E:\Python\Python37-32\lib\__pycache__\site.cpython-37.pyc matches E:\Python\Python37-32\lib\site.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\site.cpython-37.pyc'
# E:\Python\Python37-32\lib\__pycache__\os.cpython-37.pyc matches E:\Python\Python37-32\lib\os.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\os.cpython-37.pyc'
# E:\Python\Python37-32\lib\__pycache__\stat.cpython-37.pyc matches E:\Python\Python37-32\lib\stat.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\stat.cpython-37.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x002CFF10>
# E:\Python\Python37-32\lib\__pycache__\ntpath.cpython-37.pyc matches E:\Python\Python37-32\lib\ntpath.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\ntpath.cpython-37.pyc'
# E:\Python\Python37-32\lib\__pycache__\genericpath.cpython-37.pyc matches E:\Python\Python37-32\lib\genericpat
h.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\genericpath.cpython-37.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x009BE0B0>
import 'ntpath' # <_frozen_importlib_external.SourceFileLoader object at 0x009B7030>
# E:\Python\Python37-32\lib\__pycache__\_collections_abc.cpython-37.pyc matches E:\Python\Python37-32\lib\_coll
ections_abc.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\_collections_abc.cpython-37.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x009BE490>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x002CA850>
# E:\Python\Python37-32\lib\__pycache__\_sitebuiltins.cpython-37.pyc matches E:\Python\Python37-32\lib\_sitebui
ltins.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\_sitebuiltins.cpython-37.pyc'
import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0x002CAD10>
# E:\Python\Python37-32\lib\__pycache__\_bootlocale.cpython-37.pyc matches E:\Python\Python37-32\lib\_bootlocal
e.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\_bootlocale.cpython-37.pyc'
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
import '_bootlocale' # <_frozen_importlib_external.SourceFileLoader object at 0x002CF7F0>
# E:\Python\Python37-32\lib\encodings\__pycache__\gbk.cpython-37.pyc matches E:\Python\Python37-32\lib\encoding
s\gbk.py
# code object from 'E:\\Python\\Python37-32\\lib\\encodings\\__pycache__\\gbk.cpython-37.pyc'
import '_codecs_cn' # <class '_frozen_importlib.BuiltinImporter'>
import '_multibytecodec' # <class '_frozen_importlib.BuiltinImporter'>
import 'encodings.gbk' # <_frozen_importlib_external.SourceFileLoader object at 0x002CF790>
# E:\Python\Python37-32\lib\__pycache__\types.cpython-37.pyc matches E:\Python\Python37-32\lib\types.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\types.cpython-37.pyc'
import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x009CF9B0>
# E:\Python\Python37-32\lib\importlib\__pycache__\__init__.cpython-37.pyc matches E:\Python\Python37-32\lib\imp
ortlib\__init__.py
# code object from 'E:\\Python\\Python37-32\\lib\\importlib\\__pycache__\\__init__.cpython-37.pyc'
# E:\Python\Python37-32\lib\__pycache__\warnings.cpython-37.pyc matches E:\Python\Python37-32\lib\warnings.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\warnings.cpython-37.pyc'
import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x009E3310>
import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x009CFA10>
# E:\Python\Python37-32\lib\importlib\__pycache__\util.cpython-37.pyc matches E:\Python\Python37-32\lib\importl
ib\util.py
# code object from 'E:\\Python\\Python37-32\\lib\\importlib\\__pycache__\\util.cpython-37.pyc'
# E:\Python\Python37-32\lib\importlib\__pycache__\abc.cpython-37.pyc matches E:\Python\Python37-32\lib\importli
b\abc.py
# code object from 'E:\\Python\\Python37-32\\lib\\importlib\\__pycache__\\abc.cpython-37.pyc'
# E:\Python\Python37-32\lib\importlib\__pycache__\machinery.cpython-37.pyc matches E:\Python\Python37-32\lib\im
portlib\machinery.py
# code object from 'E:\\Python\\Python37-32\\lib\\importlib\\__pycache__\\machinery.cpython-37.pyc'
import 'importlib.machinery' # <_frozen_importlib_external.SourceFileLoader object at 0x00A42450>
import 'importlib.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x009E3E50>
# E:\Python\Python37-32\lib\__pycache__\contextlib.cpython-37.pyc matches E:\Python\Python37-32\lib\contextlib.
py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\contextlib.cpython-37.pyc'
# E:\Python\Python37-32\lib\collections\__pycache__\__init__.cpython-37.pyc matches E:\Python\Python37-32\lib\c
ollections\__init__.py
# code object from 'E:\\Python\\Python37-32\\lib\\collections\\__pycache__\\__init__.cpython-37.pyc'
# E:\Python\Python37-32\lib\__pycache__\operator.cpython-37.pyc matches E:\Python\Python37-32\lib\operator.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\operator.cpython-37.pyc'
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x00A643B0>
# E:\Python\Python37-32\lib\__pycache__\keyword.cpython-37.pyc matches E:\Python\Python37-32\lib\keyword.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\keyword.cpython-37.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x00A64930>
# E:\Python\Python37-32\lib\__pycache__\heapq.cpython-37.pyc matches E:\Python\Python37-32\lib\heapq.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\heapq.cpython-37.pyc'
import '_heapq' # <class '_frozen_importlib.BuiltinImporter'>
import 'heapq' # <_frozen_importlib_external.SourceFileLoader object at 0x00A689F0>
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# E:\Python\Python37-32\lib\__pycache__\reprlib.cpython-37.pyc matches E:\Python\Python37-32\lib\reprlib.py
# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\reprlib.cpython-37.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x00A68EF0>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x00A4E3F0>
# E:\Python\Python37-32\lib\__pycache__\functools.cpython-37.pyc matches E:\Python\Python37-32\lib\functools.py

# code object from 'E:\\Python\\Python37-32\\lib\\__pycache__\\functools.cpython-37.pyc'
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x00A682B0>
import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x00A421D0>
import 'importlib.util' # <_frozen_importlib_external.SourceFileLoader object at 0x009E3290>
# possible namespace for E:\Python\Python37-32\lib\site-packages\metapensiero
# possible namespace for E:\Python\Python37-32\lib\site-packages\mpl_toolkits
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x002BDD10>
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
>>> ^Z

# clear builtins._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.__interactivehook__
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup[2] removing sys
# cleanup[2] removing builtins
# cleanup[2] removing _frozen_importlib
# cleanup[2] removing _imp
# cleanup[2] removing _thread
# cleanup[2] removing _warnings
# cleanup[2] removing _weakref
# cleanup[2] removing zipimport
# cleanup[2] removing _frozen_importlib_external
# cleanup[2] removing _io
# cleanup[2] removing marshal
# cleanup[2] removing nt
# cleanup[2] removing winreg
# cleanup[2] removing encodings
# destroy encodings
# cleanup[2] removing codecs
# cleanup[2] removing _codecs
# cleanup[2] removing encodings.aliases
# cleanup[2] removing encodings.utf_8
# cleanup[2] removing _signal
# cleanup[2] removing __main__
# destroy __main__
# cleanup[2] removing encodings.latin_1
# cleanup[2] removing io
# destroy io
# cleanup[2] removing abc
# cleanup[2] removing _abc
# cleanup[2] removing site
# destroy site
# cleanup[2] removing os
# cleanup[2] removing stat
# cleanup[2] removing _stat
# cleanup[2] removing ntpath
# cleanup[2] removing genericpath
# cleanup[2] removing os.path
# cleanup[2] removing _collections_abc
# cleanup[2] removing _sitebuiltins
# cleanup[2] removing _bootlocale
# destroy _bootlocale
# cleanup[2] removing _locale
# cleanup[2] removing encodings.gbk
# cleanup[2] removing _codecs_cn
# cleanup[2] removing _multibytecodec
# cleanup[2] removing types
# cleanup[2] removing importlib
# destroy importlib
# cleanup[2] removing importlib._bootstrap
# cleanup[2] removing importlib._bootstrap_external
# cleanup[2] removing warnings
# cleanup[2] removing importlib.util
# cleanup[2] removing importlib.abc
# cleanup[2] removing importlib.machinery
# cleanup[2] removing contextlib
# destroy contextlib
# cleanup[2] removing collections
# destroy collections
# cleanup[2] removing operator
# destroy operator
# cleanup[2] removing _operator
# cleanup[2] removing keyword
# destroy keyword
# cleanup[2] removing heapq
# cleanup[2] removing _heapq
# cleanup[2] removing itertools
# cleanup[2] removing reprlib
# destroy reprlib
# cleanup[2] removing _collections
# cleanup[2] removing functools
# cleanup[2] removing _functools
# cleanup[2] removing metapensiero
# destroy metapensiero
# cleanup[2] removing mpl_toolkits
# destroy mpl_toolkits
# cleanup[2] removing atexit
# destroy zipimport
# destroy _signal
# destroy _sitebuiltins
# destroy ntpath
# destroy _stat
# destroy genericpath
# destroy os
# destroy stat
# destroy _locale
# destroy importlib.util
# destroy importlib.abc
# destroy functools
# destroy types
# destroy importlib.machinery
# destroy warnings
# destroy abc
# destroy _collections_abc
# destroy heapq
# destroy atexit
# destroy _operator
# destroy _heapq
# destroy itertools
# destroy _collections
# destroy _abc
# destroy _functools
# cleanup[3] wiping _frozen_importlib
# destroy _frozen_importlib_external
# cleanup[3] wiping _imp
# cleanup[3] wiping _thread
# cleanup[3] wiping _warnings
# cleanup[3] wiping _weakref
# cleanup[3] wiping _io
# cleanup[3] wiping marshal
# cleanup[3] wiping nt
# cleanup[3] wiping winreg
# cleanup[3] wiping codecs
# cleanup[3] wiping _codecs
# cleanup[3] wiping encodings.aliases
# cleanup[3] wiping encodings.utf_8
# cleanup[3] wiping encodings.latin_1
# cleanup[3] wiping encodings.gbk
# cleanup[3] wiping _codecs_cn
# destroy _codecs_cn
# cleanup[3] wiping _multibytecodec
# cleanup[3] wiping importlib._bootstrap
# cleanup[3] wiping sys
# cleanup[3] wiping builtins

C:\Users\Administrator>e:

E:\>dir
 驱动器 E 中的卷是 dev
 卷的序列号是 0005-B3E1

 E:\ 的目录

2018/06/22  22:03    <DIR>          adt-bundle-windows-x86-20140702
2017/07/03  21:09    <DIR>          apache-tomcat-7.0.54
2019/12/12  11:43    <DIR>          apache-tomcat-7dev
2018/11/13  20:33    <DIR>          DCULC
2018/03/19  08:39    <DIR>          downloads
2020/01/27  14:16    <DIR>          gm
2017/05/31  11:02    <DIR>          gy
2017/02/20  12:17    <DIR>          jdk1.6.0_43
2017/02/20  12:17    <DIR>          jdk1.7
2017/11/02  22:20    <DIR>          KuGou
2017/02/17  15:06    <DIR>          ldruner
2018/05/09  21:07    <DIR>          mongodb
2020/10/13  08:39    <DIR>          MyEclipse2014
2017/02/27  17:25    <DIR>          pdi-ce-4.4.0-stable
2017/03/10  00:31    <DIR>          phpwind
2020/10/26  18:09    <DIR>          PLSQL1103
2017/02/27  17:11    <DIR>          Program Files
2020/03/23  20:53    <DIR>          Program Files (x86)
2020/03/17  11:30    <DIR>          PyCharm
2020/05/08  19:21    <DIR>          pygame
2020/03/24  22:53    <DIR>          Python
2017/11/20  12:33    <DIR>          QLDownload
2018/10/17  19:34    <DIR>          R2015b
2017/02/20  12:17    <DIR>          SecureCRT6.2
2017/02/20  12:17    <DIR>          SQLyog
2018/04/08  22:00    <DIR>          Street Fighter X Tekken
2017/03/13  12:53    <DIR>          Sybase
2017/12/26  19:19    <DIR>          tc
2017/12/26  19:19    <DIR>          tc3
2019/09/06  23:29    <DIR>          tmp
2017/02/17  02:54    <DIR>          Tomcat 5.5
2020/05/06  19:43    <DIR>          UniEAP
2020/05/06  19:44    <DIR>          unieapworkspace
2019/05/18  10:23    <DIR>          vbox
2018/01/02  15:59               993 vivi.lic
2020/10/08  13:28            40,818 vivissi.log
2020/09/20  15:30            38,447 vivissi.log.2020-09-20
2020/02/27  15:30    <DIR>          vm10
2018/04/13  22:58    <DIR>          WeSingCache
2019/05/14  04:43     9,818,542,247 win10201905.GHO
2019/05/13  20:50            36,864 win10bcdeditback20190513
2019/05/14  04:13    38,442,446,447 win720190501.GHO
2019/05/13  20:55            36,864 win7bcdeditback20190513
2017/02/17  14:20    <DIR>          workspace-pgonegap
2020/07/02  02:29    <DIR>          Workspaces
2018/03/26  20:07    <DIR>          xcx
2020/01/29  16:48    <DIR>          yxdown
2017/02/27  17:25    <DIR>          服务器监控系统
2017/05/15  21:35    <DIR>          迅雷下载
               7 个文件 48,261,142,680 字节
              42 个目录 715,787,345,920 可用字节

E:\>cd xcx

E:\xcx>dir
 驱动器 E 中的卷是 dev
 卷的序列号是 0005-B3E1

 E:\xcx 的目录

2018/03/26  20:07    <DIR>          .
2018/03/26  20:07    <DIR>          ..
2018/03/26  20:07    <DIR>          helloworld
2018/03/26  17:49             2,326 helloworld.rar
2018/03/26  11:15        83,669,608 wechat_devtools_1.02.1803210_x64.exe
               2 个文件     83,671,934 字节
               3 个目录 715,787,345,920 可用字节

E:\xcx>pip install --download . cx_Oracle

Usage:
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

no such option: --download

E:\xcx>pip download . cx_Oracle
Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.

E:\xcx>cd ..

E:\>cd package

E:\package>dir
 驱动器 E 中的卷是 dev
 卷的序列号是 0005-B3E1

 E:\package 的目录

2020/10/27  16:24    <DIR>          .
2020/10/27  16:24    <DIR>          ..
2020/10/27  16:25                16 requirement.txt
               1 个文件             16 字节
               2 个目录 715,787,378,688 可用字节

E:\package>pip download E:\package -r requirements.txt
Directory 'E:\\package' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.

E:\package>pip download E:/package -r requirements.txt
Directory 'E:/package' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.

E:\package>pip download -d E:\package -r requirements.txt
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

E:\package>dir
 驱动器 E 中的卷是 dev
 卷的序列号是 0005-B3E1

 E:\package 的目录

2020/10/27  16:24    <DIR>          .
2020/10/27  16:24    <DIR>          ..
2020/10/27  16:25                16 requirement.txt
               1 个文件             16 字节
               2 个目录 715,787,378,688 可用字节

E:\package>pip download -d E:\package -r requirements.txt

E:\package>pip download -r requirements.txt -d E:\package
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

E:\package>dir
 驱动器 E 中的卷是 dev
 卷的序列号是 0005-B3E1

 E:\package 的目录

2020/10/27  16:24    <DIR>          .
2020/10/27  16:24    <DIR>          ..
2020/10/27  16:25                16 requirement.txt
               1 个文件             16 字节
               2 个目录 715,787,378,688 可用字节

E:\package>more requirement.txt
cx-Oracle==7.3.0

E:\package>pip download -r requirements.txt -d E:/package
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

E:\package>pip download -r E:/package/requirements.txt -d E:/package
Could not open requirements file: [Errno 2] No such file or directory: 'E:/package/requirements.txt'

E:\package>pip download -r E:/package/requirements.txt -d /package
Could not open requirements file: [Errno 2] No such file or directory: 'E:/package/requirements.txt'

E:\package>pip download -r requirements.txt -d /package
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

E:\package>pip download -r requirements.txt -d "E:/package"
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

E:\package>pip download -r "requirements.txt" -d "E:/package"
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

E:\package>pip download pymysql -d "E:/package"
Looking in indexes: https://pypi.tuna.tsinghua.edu/simple
Collecting pymysql
  Downloading https://pypi.tuna.tsinghua.edu/packages/1a/ea/dd9c81e2d85efd03cfbf808736dd055bd9ea1a78aea99688
88b1055c3263/PyMySQL-0.10.1-py2.py3-none-any.whl (47kB)
    100% |████████████████████████████████| 51kB 287kB/s
  Saved e:\package\pymysql-0.10.1-py2.py3-none-any.whl
Successfully downloaded pymysql

E:\package>pip download cx_oracle -d "E:/package"
Looking in indexes: https://pypi.tuna.tsinghua.edu/simple
Collecting cx_oracle
  Downloading https://pypi.tuna.tsinghua.edu/packages/e5/88/6e810dccbed30398d79f543ab95b652e91d8bc94398d049c
788ac5d88767/cx_Oracle-8.0.1-cp37-cp37m-win32.whl (140kB)
    100% |████████████████████████████████| 143kB 1.4MB/s
  Saved e:\package\cx_oracle-8.0.1-cp37-cp37m-win32.whl
Successfully downloaded cx-oracle

E:\package>pip download pymysql -d E:/package
Looking in indexes: https://pypi.tuna.tsinghua.edu/simple
Collecting pymysql
  File was already downloaded e:\package\PyMySQL-0.10.1-py2.py3-none-any.whl
Successfully downloaded pymysql

E:\package>pip download -d E:/package
ERROR: You must give at least one requirement to download (see "pip help download")

E:\package>pip download -d E:/package pymysql
Looking in indexes: https://pypi.tuna.tsinghua.edu/simple
Collecting pymysql
  File was already downloaded e:\package\PyMySQL-0.10.1-py2.py3-none-any.whl
Successfully downloaded pymysql

E:\package>pip download -d E:/package -r r.txt
Looking in indexes: https://pypi.tuna.tsinghua.edu/simple
Collecting cx-Oracle==7.3.0 (from -r r.txt (line 1))
  Downloading https://pypi.tuna.tsinghua.edu/packages/37/79/2537adc3db3c82a5fe36f89bd8e1ad6a3d08b15260135f9f
785d6b7f2ffe/cx_Oracle-7.3.0-cp37-cp37m-win32.whl (134kB)
    100% |████████████████████████████████| 143kB 578kB/s
  Saved e:\package\cx_oracle-7.3.0-cp37-cp37m-win32.whl
Successfully downloaded cx-Oracle

E:\package>pip download -r r.txt  -d E:/package
Looking in indexes: https://pypi.tuna.tsinghua.edu/simple
Collecting cx-Oracle==7.3.0 (from -r r.txt (line 1))
  File was already downloaded e:\package\cx_Oracle-7.3.0-cp37-cp37m-win32.whl
Successfully downloaded cx-Oracle

E:\package>pip download -r rrrrrrrrrr.txt  -d E:/package
Looking in indexes: https://pypi.tuna.tsinghua.edu/simple
Collecting cx-Oracle==7.3.0 (from -r rrrrrrrrrr.txt (line 1))
  File was already downloaded e:\package\cx_Oracle-7.3.0-cp37-cp37m-win32.whl
Successfully downloaded cx-Oracle

E:\package>pip download -r rrrrrrrrrr.txt  -d E:/package
Looking in indexes: https://pypi.tuna.tsinghua.edu/simple
Collecting cx-Oracle==7.3.0 (from -r rrrrrrrrrr.txt (line 1))
  File was already downloaded e:\package\cx_Oracle-7.3.0-cp37-cp37m-win32.whl
Collecting xlrd==1.2.0 (from -r rrrrrrrrrr.txt (line 2))
  Downloading https://pypi.tuna.tsinghua.edu/packages/b0/16/63576a1a001752e34bf8ea62e367997530dc553b689356b9
879339cf45a4/xlrd-1.2.0-py2.py3-none-any.whl (103kB)
    100% |████████████████████████████████| 112kB 8.2kB/s
  Saved e:\package\xlrd-1.2.0-py2.py3-none-any.whl
Collecting xlwt==1.3.0 (from -r rrrrrrrrrr.txt (line 3))
  Downloading https://pypi.tuna.tsinghua.edu/packages/44/48/def306413b25c3d01753603b1a222a011b8621aed27cd7f8
9cbc27e6b0f4/xlwt-1.3.0-py2.py3-none-any.whl (99kB)
    100% |████████████████████████████████| 102kB 1.4MB/s
  Saved e:\package\xlwt-1.3.0-py2.py3-none-any.whl
Collecting openpyxl==3.0.3 (from -r rrrrrrrrrr.txt (line 4))
  Downloading https://pypi.tuna.tsinghua.edu/packages/95/8c/83563c60489954e5b80f9e2596b93a68e1ac4e4a730deb1a
ae632066d704/openpyxl-3.0.3.tar.gz (172kB)
    100% |████████████████████████████████| 174kB 3.7MB/s
  Saved e:\package\openpyxl-3.0.3.tar.gz
Collecting chardet==3.0.4 (from -r rrrrrrrrrr.txt (line 6))
  Downloading https://pypi.tuna.tsinghua.edu/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c5
1f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 6.4MB/s
  Saved e:\package\chardet-3.0.4-py2.py3-none-any.whl
Collecting jdcal (from openpyxl==3.0.3->-r rrrrrrrrrr.txt (line 4))
  Downloading https://pypi.tuna.tsinghua.edu/packages/f0/da/572cbc0bc582390480bbd7c4e93d14dc46079778ed915b50
5dc494b37c57/jdcal-1.4.1-py2.py3-none-any.whl
  Saved e:\package\jdcal-1.4.1-py2.py3-none-any.whl
Collecting et_xmlfile (from openpyxl==3.0.3->-r rrrrrrrrrr.txt (line 4))
  Downloading https://pypi.tuna.tsinghua.edu/packages/22/28/a99c42aea746e18382ad9fb36f64c1c1f04216f41797f2f0
fa567da11388/et_xmlfile-1.0.1.tar.gz
  Saved e:\package\et_xmlfile-1.0.1.tar.gz
Successfully downloaded cx-Oracle xlrd xlwt openpyxl chardet jdcal et-xmlfile

E:\package>   pip download -r requirements.txt  -d E:/package

 

本文标签: 离线 本机 环境 python pip