- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Ubuntu 20.04.1 LTS | Python 3.8.5 | pip 20.0.2(通过 python3-pip)
我不小心用自定义索引覆盖了笔记本电脑中的全局 PyPI 索引。 (它只能在虚拟环境中设置。如果它有用,我使用的是 AWS CodeArtifact。)
我在运行 pip3 config -v list
后这样说看到global.index-url
分配了另一个 URL 以及 ~/.config/.pip/pip.conf
列出相同的。
为了解决问题,我做了以下事情:
global.index-url
至"https://pypi.python.org/pypi"
,但是当我进行测试以查看它是否有效时,它在尝试安装 requests
时中途停止了在虚拟环境中(使用其 pip)并表示某些依赖项不满足。~/.config/.pip
备份,卸载 python3-pip 并重新安装包,希望重新编写配置。而新的~/config/.pip
没有创建,我能够毫无问题地将请求安装到虚拟环境中。$ pip config -v list
For variant 'global', will try loading '/etc/xdg/xdg-ubuntu/pip/pip.conf'
For variant 'global', will try loading '/etc/xdg/pip/pip.conf'
For variant 'user', will try loading '/home/<user>/.pip/pip.conf'
For variant 'user', will try loading '/home/<user>/.config/pip/pip.conf'
For variant 'site', will try loading '/home/<user>/test_env/venv/pip.conf'
当我在虚拟环境停用的情况下使用 pip3 时,输出略有不同。
$ pip3 config -v list
For variant 'global', will try loading '/etc/xdg/xdg-ubuntu/pip/pip.conf'
For variant 'global', will try loading '/etc/xdg/pip/pip.conf'
For variant 'user', will try loading '/home/<user>/.pip/pip.conf'
For variant 'user', will try loading '/home/<user>/.config/pip/pip.conf'
For variant 'site', will try loading '/usr/pip.conf'
有人可以告诉我这一切是如何运作的吗?
最佳答案
https://pypi.org/simple/包裹X
让我知道它是否正确?
使用
pip install paxckageX --verbose
现在不确定它是否正确,但在这里:
Configuration
Config file
pip allows you to set all command line option defaults in a standard ini style config file.
The names and locations of the configuration files vary slightly across platforms. You may have per-user, per-virtualenv or global (shared amongst all users) configuration:
Per-user:
On Unix the default configuration file is: $HOME/.config/pip/pip.conf which respects the XDG_CONFIG_HOME environment variable.
On macOS the configuration file is $HOME/Library/Application Support/pip/pip.conf if directory $HOME/Library/Application Support/pip exists else $HOME/.config/pip/pip.conf.
On Windows the configuration file is %APPDATA%\pip\pip.ini.
There is also a legacy per-user configuration file which is also respected. To find its location:
On Unix and macOS the configuration file is: $HOME/.pip/pip.conf
On Windows the configuration file is: %HOME%\pip\pip.ini
You can set a custom path location for this config file using the environment variable PIP_CONFIG_FILE.
Inside a virtualenv:
On Unix and macOS the file is $VIRTUAL_ENV/pip.conf
On Windows the file is: %VIRTUAL_ENV%\pip.ini
Global:
On Unix the file may be located in /etc/pip.conf. Alternatively it may be in a “pip” subdirectory of any of the paths set in the environment variable XDG_CONFIG_DIRS (if it exists), for example /etc/xdg/pip/pip.conf.
On macOS the file is: /Library/Application Support/pip/pip.conf
On Windows XP the file is: C:\Documents and Settings\All Users\Application Data\pip\pip.ini
On Windows 7 and later the file is hidden, but writeable at C:\ProgramData\pip\pip.ini
Global configuration is not supported on Windows Vista.
The global configuration file is shared by all Python installations.
If multiple configuration files are found by pip then they are combined in the following order:
The global file is read
The per-user file is read
The virtualenv-specific file is read
Each file read overrides any values read from previous files, so if the global timeout is specified in both the global file and the per-user file then the latter value will be used.
The names of the settings are derived from the long command line option, e.g. if you want to use a different package index (--index-url) and set the HTTP timeout (--default-timeout) to 60 seconds your config file would look like this:
[global]
timeout = 60
index-url = https://download.zope.org/ppix
Each subcommand can be configured optionally in its own section so that every global setting with the same name will be overridden; e.g. decreasing the timeout to 10 seconds when running the freeze (pip freeze) command and using 60 seconds for all other commands is possible with:
[global]
timeout = 60
[freeze]
timeout = 10
Boolean options like --ignore-installed or --no-dependencies can be set like this:
[install]
ignore-installed = true
no-dependencies = yes
To enable the boolean options --no-compile, --no-warn-script-location and --no-cache-dir, falsy values have to be used:
[global]
no-cache-dir = false
[install]
no-compile = no
no-warn-script-location = false
For options which can be repeated like --verbose and --quiet, a non-negative integer can be used to represent the level to be specified:
[global]
quiet = 0
verbose = 2
It is possible to append values to a section within a configuration file such as the pip.ini file. This is applicable to appending options like --find-links or --trusted-host, which can be written on multiple lines:
[global]
find-links =
http://download.example.com
[install]
find-links =
http://mirror1.example.com
http://mirror2.example.com
trusted-host =
mirror1.example.com
mirror2.example.com
This enables users to add additional values in the order of entry for such command line arguments.
Environment Variables
pip’s command line options can be set with environment variables using the format PIP_<UPPER_LONG_NAME> . Dashes (-) have to be replaced with underscores (_).
For example, to set the default timeout:
Unix/macOS
export PIP_DEFAULT_TIMEOUT=60
Windows
This is the same as passing the option to pip directly:
Unix/macOS
python -m pip --default-timeout=60 [...]
Windows
For command line options which can be repeated, use a space to separate multiple values. For example:
Unix/macOS
export PIP_FIND_LINKS="http://mirror1.example.com http://mirror2.example.com"
Windows
is the same as calling:
Unix/macOS
python -m pip install --find-links=http://mirror1.example.com --find-links=http://mirror2.example.com
Windows
Options that do not take a value, but can be repeated (such as --verbose) can be specified using the number of repetitions, so:
export PIP_VERBOSE=3
is the same as calling:
pip install -vvv
Note
Environment variables set to be empty string will not be treated as false. Please use no, false or 0 instead.
Config Precedence
Command line options have precedence over environment variables, which have precedence over the config file.
Within the config file, command specific sections have precedence over the global section.
Examples:
--host=foo overrides PIP_HOST=foo
PIP_HOST=foo overrides a config file with [global] host = foo
A command specific section in the config file [<command>] host = bar overrides the option with same name in the [global] config file section
关于python - Pip 指向哪个 PyPI 索引?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65598658/
在PyPy的 build 阶段,该脚本会生成一些看起来非常有趣的漂亮 ASCII 字符。每个字符代表什么?如何解释这个输出?在生成这种 ASCII 艺术时,PyPy build 到底在做什么? 最佳答
如何使用 PyPy(最好是 pypy3)而不是带有 poetry 的标准 python? 也就是说,pyproject.toml中应该存储什么?是否还需要进行其他更改? 最佳答案 事实证明,它就像安装
将 pypy 实现转换为 c 文件并在配备 2G 内存和 Intel Core2 2GHz CPU 的现代笔记本上构建 pypy-c 需要花费数小时。 我知道这是一个 CPU 密集型任务,但它必须这么
每次在 PyPI 上发布 Virtualenv 的新版本时,我都希望收到通知,最好通过电子邮件或 RSS 提要。这可能吗? 最佳答案 是的,可以从 pypi.org 获得 RSS 提要,请参阅:htt
我有一个 Python 扩展,需要针对基于 Windows 的 Appveyor 持续集成服务上的 PyPy 解释器进行编译。我如何在那种环境中获得 PyPy? 最佳答案 将此 PowerShell
PyPy GIL 是 RPython 中 PyPy 解释器实现的一部分,还是 translate.py 自动添加的东西?即,如果我要在 RPython 中编写自己的新语言解释器并通过 translat
我已阅读 PyPy -- How can it possibly beat CPython?以及无数其他事情,但我无法理解用 Python 编写的东西如何比 Python 本身更快。 我能想到的唯一方
我正在处理一些 OpenAI 的 API 集成。我在安装 tiktoken(用于 OpenAI 模型的快速 BPE 标记器)时遇到问题。 当我尝试在我的 macbook 机器上运行时: pip3 in
我正在处理一些 OpenAI 的 API 集成。我在安装 tiktoken(用于 OpenAI 模型的快速 BPE 标记器)时遇到问题。 当我尝试在我的 macbook 机器上运行时: pip3 in
这可能是一个非常愚蠢的问题,但是“PyPy”和“PyPI”之间有什么区别?它们是一回事吗? 最佳答案 PyPy是 python 的替代实现: PyPy is a fast, compliant alt
我想在与 Python 2.7 版本兼容的 window 7 上卸载 pypy 版本。控制面板的“卸载程序”中没有 pypy。到目前为止,我还没有找到任何文档。 最佳答案 PyPy 不会在 Windo
PyPy 是否在编译时进行静态类型检查以在编译时捕获类型错误?如果不是,像 HM 类型推断这样的东西是否有助于在编译时捕获这些错误? 最佳答案 否 在两个帐户上。 (我假设 PyPy 是指具有 JIT
我在弄清楚如何让我的 Python 包处理到 PyPi 时遇到了一些问题,这样我就可以很容易地将它与其他项目的其他依赖项一起安装(即使用需求条目或简单的“pip install xyz”)-这里列出了
例如,如果我有一个 Pypi 上已经存在的包 foo。我希望能够在我的 setup.py 中使用新版本号进行 git Push origin master 操作,然后 Pypi 以某种方式自动更新其版
新版 PyPy 附带了集成的 Stackless。据我所知,捆绑的 Stackless 与 2001 年的原始 Stackless 不同。所以主要是带有调度器的绿色线程框架。 Greenlet 是 S
我按照指南 How to submit a package to PyPI提交一个包裹。它抛出了以下错误: Traceback (most recent call last): Fi
我使用诗歌创建了一个Python包然后我使用诗歌构建、诗歌发布将我的包发布到 PyPI,但 PyPI 中缺少我的包描述。 该项目托管在 GitHub 中:https://github.com/fsis
我听说过很多关于 PyPy 项目的信息。他们声称它比 CPython 上的 their site 解释器快 6.3 倍。 每当我们谈论 Python 等动态语言时,速度都是最重要的问题之一。为了解决这
我们将 artifactoy 更新到最新版本 5.10.3 以支持 pypi 更新。 在这次更新之后,我们遇到了一些非常慢的 pip install --upgrade 时间。pip install
我一直在 ESP32-WROOM-32D 上使用 uasyncio。在所有测试之后,我正在尝试将固件用于我的其他板,但默认情况下 uasyncio 并未与 micropython 一起安装。我尝试通过
我是一名优秀的程序员,十分优秀!