❯ ls .venv 列出虚拟环境文件夹 bin CACHEDIR.TAG lib lib64 pyvenv.cfg
❯ source .venv/bin/activate 激活虚拟环境 ❯ 73%
python 版本控制 uv venv -p 3.10
venv 子选项参数
❯ uv venv -h Create a virtual environment
Usage: uv venv [OPTIONS] [NAME]
Arguments: [NAME] The path to the virtual environment to create [default: .venv]
Options: -p, --python <PYTHON> The Python interpreter to use for the virtual environment. [env: UV_PYTHON=] --system Use the system Python to uninstall packages [env: UV_SYSTEM_PYTHON=] --seed Install seed packages (`pip`, `setuptools`, and `wheel`) into the virtual environment --allow-existing Preserve any existing files or directories at the target path --prompt <PROMPT> Provide an alternative prompt prefix for the virtual environment. --system-site-packages Give the virtual environment access to the system site packages directory -i, --index-url <INDEX_URL> The URL of the Python package index (by default: <https://pypi.org/simple>) [env: UV_INDEX_URL=] --extra-index-url <EXTRA_INDEX_URL> Extra URLs of package indexes to use, in addition to `--index-url` [env: UV_EXTRA_INDEX_URL=] -f, --find-links <FIND_LINKS> Locations to search for candidate distributions, beyond those found in the indexes --no-index Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those discovered via `--find-links` --index-strategy <INDEX_STRATEGY> The strategy to use when resolving against multiple index URLs [env: UV_INDEX_STRATEGY=] [possible values: first-index, unsafe-first-match, unsafe-best-match] --keyring-provider <KEYRING_PROVIDER> Attempt to use `keyring`for authentication for index URLs [env: UV_KEYRING_PROVIDER=] [possible values: disabled, subprocess] --exclude-newer <EXCLUDE_NEWER> Limit candidate packages to those that were uploaded prior to the given date [env: UV_EXCLUDE_NEWER=] --link-mode <LINK_MODE> The method to use when installing packages from the global cache [env: UV_LINK_MODE=] [possible values: clone, copy, hardlink] -q, --quiet Do not print any output -v, --verbose... Use verbose output --color <COLOR_CHOICE> Control colors in output [default: auto] [possible values: auto, always, never] --native-tls Whether to load TLS certificates from the platform's native certificate store [env: UV_NATIVE_TLS=] --offline Disable network access, relying only on locally cached data and locally available files --toolchain-preference <TOOLCHAIN_PREFERENCE> Whether to use system or uv-managed Python toolchains [possible values: only-managed, prefer-installed-managed, prefer-managed, prefer-system, only-system] -n, --no-cache Avoid reading from or writing to the cache [env: UV_NO_CACHE=] --cache-dir <CACHE_DIR> Path to the cache directory [env: UV_CACHE_DIR=] --config-file <CONFIG_FILE> The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=] -h, --help Print help (see more with '--help') -V, --version Print version
依赖包、软件包管理 😋
❯ pip -V pip 24.1.1from /mgit/PentestGPT/.venv/lib/python3.12/site-packages/pip (python 3.12) ❯ uv pip install -r ./requirements.txt 根据项目中的依赖文件安装依赖 Resolved 113 packages in32.29s Built jieba3k==0.35.1 Built tinysegmenter==0.3 Built sgmllib3k==1.0.0 Built feedfinder2==0.0.4 Built wrapt==1.14.0
还没有评论,来说两句吧...