请求获取requests 2.18.4模块安装后的对应文件清单
Hey there! I totally get the frustration of dealing with strict approval processes for pip/pipenv—been there, done that. Let me lay out exactly what files you'll end up with when installing requests 2.18.4 via any of those methods (pip, pipenv, or setup.py all drop the same files into your site-packages/dist-packages directory). Here's the full breakdown:
Core requests/ Module Directory
This is the main folder you'll find in your site-packages/dist-packages path, containing all the core functionality:
__init__.py(the module entry point, defines version info and core public imports)__pycache__/(auto-generated Python bytecode files, e.g.,__init__.cpython-36.pycdepending on your Python version)adapters.py(handles HTTP/HTTPS connection adapters and pooling)api.py(exposes the simple public API functions likerequests.get(),requests.post())auth.py(authentication handlers including HTTPBasicAuth, HTTPDigestAuth)certs.py(bundled CA certificates for SSL verification)compat.py(compatibility layer to support different Python versions)cookies.py(cookie parsing, storage, and manipulation utilities)exceptions.py(custom exceptions likeRequestException,HTTPError)hooks.py(system for adding request/response modification hooks)models.py(defines core classes:Request,Response,PreparedRequest)packages/(embedded dependencies bundled with requests 2.18.4—details below)sessions.py(session management for persistent connections and settings)status_codes.py(lookup dictionary for HTTP status codes and their descriptions)structures.py(custom data structures likeCaseInsensitiveDict)utils.py(utility functions for URL parsing, encoding, and more)
Embedded Dependencies in requests/packages/
Requests 2.18.4 bundles these dependencies instead of requiring separate installs, so you'll see these subdirectories:
chardet/(full chardet library for detecting text encodings)idna/(full idna library for handling internationalized domain names)urllib3/(full urllib3 library, the underlying HTTP client that requests uses)__init__.py(imports for accessing bundled packages)__pycache__/(bytecode files for the packages module)
Top-Level Metadata Files
Outside the requests/ folder, you'll find these metadata files in your site-packages directory:
requests-2.18.4.dist-info/(directory holding all package metadata)INSTALLER(text file indicating the installer used, e.g., "pip" or "setup.py")LICENSE(MIT license text for the requests library)METADATA(detailed package info: author, dependencies, description, version history)RECORD(a list of every installed file, including their hashes and file sizes)WHEEL(only present if installed via a wheel package; contains wheel-specific metadata)top_level.txt(lists the top-level module name, which is justrequestshere)
requests.pth(optional, some environments use this file to tell Python where to locate the requests module)
Optional Scripts (System-Dependent)
On Unix-like systems (or Windows with Python added to your PATH), you might also get a script file, though note:
The
requests-clicommand-line tool wasn't included by default in requests 2.18.4, so this is only present if you installed a custom build that includes it.
内容的提问来源于stack exchange,提问作者AKS

