pip install from requirements忽略库fork

时间:2017-12-20 16:26:31

标签: python pip

我将依赖fork源的库(sqlalchemy)和另一个库(alembic)添加到requirements.txt。在安装叉和源期间安装。
为什么会这样?可以将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 

1 个答案:

答案 0 :(得分:1)

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