折腾:
【已解决】Flask中SQLAlchemy的pagination传入page为2时出错:LookupError “” is not among the defined enum values
期间,看到通过pip去下载太慢:
(RunningFast) ➜ staging pip install -U SQLAlchemy Collecting SQLAlchemy Downloading SQLAlchemy-1.1.3.tar.gz (5.1MB) 0% |▏ | 20kB 2.3kB/s eta 0:37:31 |
想要去:
自己手动下载后,
再去通过pip安装本地已下载好的包
-》
SQLAlchemy 1.1.3 : Python Package Index
-》
-》
pip install local
Installing Python packages from local file system folder with pip – Stack Overflow
pip install mypackage –no-index –find-links file:///srv/pkg/mypackage
(RunningFast) ➜ stable pip install SQLAlchemy –no-index –find-links ./SQLAlchemy-1.1.3.tar.gz Ignoring indexes: https://pypi.python.org/simple Requirement already satisfied (use –upgrade to upgrade): SQLAlchemy in /root/Envs/RunningFast/lib/python2.7/site-packages (RunningFast) ➜ stable pip install -U SQLAlchemy –no-index –find-links ./SQLAlchemy-1.1.3.tar.gz Ignoring indexes: https://pypi.python.org/simple Collecting SQLAlchemy Building wheels for collected packages: SQLAlchemy Running setup.py bdist_wheel for SQLAlchemy … done Stored in directory: /root/.cache/pip/wheels/69/24/81/b54efd67b032c8097436294d5cc8e8a5a05b4669295827c40e Successfully built SQLAlchemy Installing collected packages: SQLAlchemy Found existing installation: SQLAlchemy 1.1.1 Uninstalling SQLAlchemy-1.1.1: Successfully uninstalled SQLAlchemy-1.1.1 Successfully installed SQLAlchemy-1.1.3 |
【总结】
用pip从本地安装某个库的话,可以用:
pip install PackageName –no-index –find-links file:///path/to/your/package |
比如:
我此处升级对应的SQLAlchemy:
pip install -U SQLAlchemy –no-index –find-links ./SQLAlchemy-1.1.3.tar.gz |
转载请注明:在路上 » 【已解决】如何使用pip去本地安装Python的包文件