gpt4 book ai didi

python - 从需求中安装 pip 会忽略库分支

转载 作者:太空宇宙 更新时间:2023-11-03 14:21:35 25 4
gpt4 key购买 nike

我将依赖于 fork 源的库 (sqlalchemy) 和另一个库 (alembic) 的 fork 添加到requirements.txt。在安装过程中,fork 和源已经安装。
为什么会发生这种情况? fork可以作为依赖安装吗?

这是安装过程及其结果:

➜  ~ mkdir test_reqs
➜ ~ cd test_reqs
➜ test_reqs echo "alembic==0.9.3
-e git+https://github.com/aCLr/sqlalchemy.git#egg=rel_1_bind_url_as_key" > reqs.txt
➜ test_reqs virtualenv2 venv
New python executable in /home/anton/test_reqs/venv/bin/python2
Also creating executable in /home/anton/test_reqs/venv/bin/python
Installing setuptools, pip, wheel...done.
➜ test_reqs source venv/bin/activate
(venv) ➜ test_reqs pip install -r reqs.txt
Collecting alembic==0.9.3 (from -r reqs.txt (line 1))
Obtaining rel_1_bind_url_as_key from git+https://github.com/aCLr/sqlalchemy.git#egg=rel_1_bind_url_as_key (from -r reqs.txt (line 2))
Cloning https://github.com/aCLr/sqlalchemy.git to ./venv/src/rel-1-bind-url-as-key
Running setup.py (path:/home/anton/test_reqs/venv/src/rel-1-bind-url-as-key/setup.py) egg_info for package rel-1-bind-url-as-key produced metadata for project name sqlalchemy. Fix your #egg=rel-1-bind-url-as-key fragments.
Collecting SQLAlchemy>=0.7.6 (from alembic==0.9.3->-r reqs.txt (line 1))
Collecting Mako (from alembic==0.9.3->-r reqs.txt (line 1))
Collecting python-editor>=0.3 (from alembic==0.9.3->-r reqs.txt (line 1))
Collecting python-dateutil (from alembic==0.9.3->-r reqs.txt (line 1))
Using cached python_dateutil-2.6.1-py2.py3-none-any.whl
Collecting MarkupSafe>=0.9.2 (from Mako->alembic==0.9.3->-r reqs.txt (line 1))
Collecting six>=1.5 (from python-dateutil->alembic==0.9.3->-r reqs.txt (line 1))
Using cached six-1.11.0-py2.py3-none-any.whl
Installing collected packages: SQLAlchemy, MarkupSafe, Mako, python-editor, six, python-dateutil, alembic, sqlalchemy
Running setup.py develop for sqlalchemy
Successfully installed Mako-1.0.7 MarkupSafe-1.0 SQLAlchemy-1.1.15 alembic-0.9.3 python-dateutil-2.6.1 python-editor-1.0.3 six-1.11.0 sqlalchemy-1.1.15
(venv) ➜ test_reqs pip list|grep -i sqlalchemy
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
SQLAlchemy (1.1.15, /home/anton/test_reqs/venv/lib/python2.7/site-packages)
(venv) ➜ test_reqs pip uninstall sqlalchemy
Uninstalling SQLAlchemy-1.1.15:
...
Proceed (y/n)? y
Successfully uninstalled SQLAlchemy-1.1.15
(venv) ➜ test_reqs pip uninstall sqlalchemy
Uninstalling SQLAlchemy-1.0.20.dev0:
/home/anton/test_reqs/venv/lib/python2.7/site-packages/SQLAlchemy.egg-link
Proceed (y/n)? ^COperation cancelled by user
(venv) ➜ test_reqs pip list|grep -i sqlalchemy
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
SQLAlchemy (1.0.20.dev0, /home/anton/test_reqs/venv/src/rel-1-bind-url-as-key/lib)
(venv) ➜ test_reqs pip uninstall sqlalchemy
Uninstalling SQLAlchemy-1.0.20.dev0:
/home/anton/test_reqs/venv/lib/python2.7/site-packages/SQLAlchemy.egg-link
Proceed (y/n)? y
Successfully uninstalled SQLAlchemy-1.0.20.dev0
(venv) ➜ test_reqs

最佳答案

-e 是额外的,没有它一切正常:)

关于python - 从需求中安装 pip 会忽略库分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47910458/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com