最近需要在单位电脑需要搭建Python环境,会用到很多的第三方库,一个个安装显得十分的繁琐,而在windows下的pip批量安装的方法pip install -r requirements.txt 又存在着遇到错误直接中止,不再继续安装后面的库的问题。
将需要安装的第三方库放入requirements.txt文件
编写脚本,解决超时问题和跳过错误安装问题,取名为:install_req.py
import sys
from pip._internal import main as pip_main
def install(package):
pip_main(['--default-timeout=1000','install','-U', package])
if __name__=='__main__':
with open(sys.argv[1]) as f:
for line in f:
install(line)
python install_req.py requirements.txt (两个文件要在一个路径下)
python后面第一个参数为你编写的python脚本的路径(包括文件名称),第二个参数为你的第三方依赖名称列表的文件路径(包括文件名称)
aiodns
aiohttp
altgraph
asgiref
asn1crypto
astroid
async-timeout
attrs
Automat
autopep8
backcall
basemap
bcrypt
beautifulsoup4
bleach
boto
boto3
botocore
branca
bz2file
captcha
cchardet
certifi
cffi
chardet
charset-normalizer
Click
colorama
configparser
constantly
cookiecutter-django
cryptography
cssselect
cycler
datatables
deap
decorator
defusedxml
Deprecated
Django
django-allauth
django-cors-headers
django-pipeline
dnspython
docopt
docutils
docxcompose
docxtpl
dukpy
echarts-china-cities-pypkg
echarts-china-counties-pypkg
echarts-china-misc-pypkg
echarts-china-provinces-pypkg
echarts-countries-pypkg
echarts-united-kingdom-pypkg
ecos
elasticsearch
entrypoints
et-xmlfile
eyeD3
f5-icontrol-rest
f5-sdk
fabric
fake-useragent
Flask
folium
fpdf
future
fuzzywuzzy
gensim
geocoder
geographiclib
Geohash
geopy
geos
gerapy
gitdb2
GitPython
graphviz
hexdump
html5lib
hyperlink
idna
imbalanced-learn
imblearn
importlib-resources
incremental
invoke
IPy
ipykernel
ipython
ipython-genutils
ipywidgets
isort
itsdangerous
javascripthon
jdcal
jedi
Jinja2
jmespath
jsonschema
junos-eznc
jupyter
jupyter-client
jupyter-console
jupyter-core
jupyter-echarts-pypkg
knnimpute
lazy-object-proxy
libpagure
lml
lxml
macholib
macropy3
Markdown
MarkupSafe
matplotlib
mccabe
mistune
more-itertools
mpl-finance
mpmath
multidict
mysqlclient
nbconvert
nbformat
ncclient
netaddr
netmiko
networkx
nltk
notebook
ntc-templates
numpy
oauthlib
odfpy
ogr
olefile
openpyxl
osqp
OSR
pandas
pandocfilters
paramiko
parsel
parso
pathlib2
patsy
pefile
pexpect
pickleshare
Pillow
plotly
plotly-express
prometheus-client
prompt-toolkit
protobuf
psutil
ptyprocess
pyasn1
pyasn1-modules
pycares
pycharts
pycodestyle
pycparser
pycurl
PyDispatcher
pydotplus
pyeapi
pyecharts
pyecharts-javascripthon
pyecharts-jupyter-installer
pyexcel
pyexcel-io
PyGithub
pyglet
Pygments
PyInstaller
PyJWT
pylint
pymongo
PyMySQL
PyNaCl
pyntc
pynxos
pyOpenSSL
pyparsing
pypinyin
pypiwin32
pyproj
PyQt5
PyQt5-Qt5
PyQt5-sip
pyserial
pyshp
python-dateutil
python-docx
python-evtx
python-gitlab
python-magic
python-scrapyd-api
python3-openid
pytz
pywin32
pywin32-ctypes
pywinpty
PyYAML
pyzmq
qtconsole
queuelib
ratelim
redis
requests
requests-oauthlib
retrying
rsa
s3transfer
scapy
scikit-learn
scipy
scp
Scrapy
scrapy-redis
scrapy-splash
seaborn
selenium
Send2Trash
service-identity
six
smart-open
smmap2
some-package
sqlparse
statsmodels
stopit
sympy
tablib
tenacity
tensorflow
tensorflow-tensorboard
terminado
testpath
textfsm
texttable
Theano
tilemapbase
tornado
TPOT
tqdm
traitlets
transitions
Twisted
typed-ast
typing
typing-extensions
unicodecsv
update-checker
urllib3
utm
virtualenv
w3lib
wcwidth
Werkzeug
widgetsnbextension
WMI
wordcloud
wrapt
xlrd
XlsxWriter
xlwt
xpinyin
yamlordereddictloader
yarl
you-get
zipp
zope.interface
ldap
ldap3
delorean
maya
pendulum
when.py
moment
ftfy
thefuzz
pangu.py
uniout
pyfiglet
flashtext
textdistance
awesome-slugify
python-slugify
unicode-slugify
python-phonenumbers
PLY
python-nameparser
python-user-agents
Marmir
python-pptx
relatorio
unoconv
xlwings
PDF
PyPDF2
ReportLab
Python-Markdown
YAML
CSV
Archive
unp
Pattern
TextBlob
TextGrocery
polyglot
pytext
PyTorch-NLP
spacy
Stanza
funNLP
pkuseg-python
Sphinx
awesome-sphinxdoc
MkDocs
pdoc
Pycco
readthedocs
config
ConfigObj
profig
python-decouple
hydra
cement
cliff
clint
Gooey
python-prompt-toolkit
python-fire
Pythonpy
asciimatics
alive-progress
bashplotlib
rich
aws-cli
caniusepython3
cookiecutter
doitlive
pyftpdlib
howdoi
PathPicker
percol
thefuck
try
copier
tmuxp
httpie
iredis
kube-shell
litecli
mycli
pgcli
SAWS
Shell
xonsh
s3cmd
s4cmd
youtube-dl
akshare
hmap
nude.py
python-barcode
pygram
Quads
scikit-image
thumbor
wand
pagan
PyMatting
pywal
pyvips
audioread
beets
django-elastic-transcoder
m3u8
mutagen
pydub
pyechonest
talkbox
kapre
librosa
matchering
pyAudioAnalysis
vidgear
geojson
GeoIP2
django-countries
pygeoip
grequests
treq
httpx
ZODB
MySQL
aiomysql
mysql-python
ysqlclient
oursql
PostgreSQL
psycopg2
queries
txpostgres
apsw
dataset
pymssql
asyncio-redis
cassandra-python-driver
HappyBase
Plyvel
py2neo
pycassa
redis-py
telephus
txRedis
kafka-python
motor
awesome-sqlalchemy
SQLAlchemy
Peewee
PonyORM
python-sql
orator
orm
pony
pydal
django-mongodb-engine
PynamoDB
flywheel
MongoEngine
hot-redis
redisco
butterdb
Pyramid
Bottle
CherryPy
TurboGears
web.py
web2py
sanic
starlette
Masonite
autobahn-python
channels
websockets
django-guardian
django-rules
django-cms
FeinCMS
Kotti
Mezzanine
Plone
Quokka
Wagtail
Widgy
indico
django-oscar
django-shop
Cartridge
shoop
alipay
merchant
money
python-currencies
forex-python
saleor
django-rest-framework
django-tastypie
django-formapi
flask-api
flask-restful
flask-restless
flask-api-utils
eve
cornice
falcon
sandman
restless
ripozo
apistar
fastapi
hug
sandman2
vibora
authlib
Authomatic
django-oauth-toolkit
django-oauth2-provider
Flask-OAuthlib
python-oauth2
python-social-auth
rauth
sanction
python-jws
python-jwt
python-jose
Chameleon
Genshi
Mako
celery
daramatiq
huey
mrq
rq
simpleq
django-haystack
elasticsearch-py
elasticsearch-dsl-py
solrpy
pysolr
Whoosh
django-activity-stream
Stream-Framework
django-compressor
django-storages
fanstatic
FileConveyor
Flask-Assets
jinja-assets-compressor
webassets
Beaker
django-cache-machine
django-cacheops
django-viewlet
dogpile.cache
HermesCache
johnny-cache
pylibmc
python-diskcache
django-celery-ses
envelopes
flanker
imbox
inbox.py
inbox
lamson
mailjet
marrow.mailer
modoboa
pyzmail
Talon
yagmail
salmon
mailer
Babel
Korean
PyICU
furl
purl
pyshorteners
shorturl
webargs
BeautifulSoup
cssutils
pyquery
requests-html
untangle
xhtml2pdf
xmltodict
WeasyPrint
xmldataset
ScrapydWeb
Demiurge
feedparser
MechanicalSoup
portia
RoboBrowser
Haul
lassie
micawber
newspaper
opengraph
goose3
python-readability
sanitize
sumy
textract
Deform
django-bootstrap3
django-bootstrap4
django-crispy-forms
django-remote-forms
WTForms
WTForms-JSON
Cerberus
colander
kmatch
schema
Schematics
valideer
voluptuous
marshmallow
pysimdjson
python-rapidjson
ultrajson
django-simple-captcha
django-simple-spam-blocker
Ajenti
django-suit
django-xadmin
flask-admin
flower
Grappelli
Wooey
django-grappelli
django-jet
jet-bridge
python-lambda
Zappa
Pelican
Cactus
Hyde
Nikola
Tinkerer
Lektor
makesite
envoy
sarge
sh
multiprocessing
threading
eventlet
gevent
Tomorrow
uvloop
concurrent.futures
scoop
asyncio
trio
pulsar
diesel
Toapi
txZMQ
AutobahnPython
Crossbar
django-socketio
WebSocket-for-Python
gunicorn
uwsgi
bjoern
fapws3
meinheld
netius
paste
rocket
waitress
daphne
uvicorn
SimpleJSONRPCServer
SimpleXMLRPCServer
zeroRPC
RPyC
hashids
Passlib
PyCrypto
curses
enaml
kivy
PySide
Toga
urwid
PyGObject
Flexx
Eel
PySimpleGUI
pywebview
DearPyGui
logging
logbook
Eliot
Raven
Sentry
sentry-python
loguru
structlog
unittest
nose
contexts
hypothesis
mamba
pyshould
pytest
green
pyvows
RobotFramework
tox
PyAutoGUI
locust
sixpack
splinter
Schemathesis
mock
doublex
freezegun
httmock
httpretty
responses
VCR.py
mocket
faker
fake2db
mimesis
radar
FuckIt.py
fsociety
setoolkit
sqlmap
coala
code2flow
pycallgraph
pysonar2
prospector
vulture
Flake8
YAPF
pylama
wemake-python-styleguide
black
mypy
pyre-check
typeshed
MonkeyType
pyannotate
pytype
ipdb
pudb
pyringe
wdb
winpdb
lptrace
manhole
python-hunter
pyelftools
python-statsd
django-debug-toolbar
django-devserver
flask-debugtoolbar
icecream
astropy
bcbio-nextgen
bccb
Biopython
blaze
cclib
Neupy
orange
PyDy
RDKit
zipline
Bayesian-belief-networks
AWSDataWrangler
Optimus
Colour
KarateClub
NIPY
ObsPy
QuTiP
SimPy
bokeh
ggplot
pygal
pygraphviz
PyQtGraph
SnakeViz
vincent
VisPy
Altair
bqplot
Cartopy
Dash
diagrams
plotnine
EasyOCR
FaceRecognition
Kornia
tesserocr
Caffe
Caffe2
MXNet
SerpentAI
skflow
pydeep
PyBrain
Pylearn2
python-recsys
vowpalporpoise
gym
H2O
Metrics
vowpal_porpoise
xgboost
MindsDB
annoy
fastFM
implicit
libffm
lightfm
spotlight
Surprise
tensorrec
dpark
dumbo
luigi
mrjob
dask
PySpark
Ray
faust
streamparse
mars
CyToolz
fn.py
funcy
Toolz
Coconut
returns
Ansible
SaltStack
OpenStack
DockerCompose
cuisine
Fabtools
gitapi
hgapi
honcho
supervisor
cloudinit
pyinfra
BorgBackup
docker-compose
APScheduler
django-schedule
doit
gunnery
Joblib
Plan
schedule
Spiff
TaskFlow
Airflow
Prefect
ctypes
PyCUDA
SWIG
Cython
CLPython
Grumpy
IronPython
Jython
MicroPython
Pyjion
Numba
PeachPy
PyPy
Pyston
StacklessPython
pythonlibs
PythonNet
WinPython
Mininet
POX
Pyretic
SDXPlatform
NRU
napalm
wifi
keyboard
mouse
Python-Future
modernize
algorithms
python-ds
sortedcontainers
TheAlgorithms
PyPattyrn
python-patterns
bidict
Box
dataclasses
DottedDict
cx_Oracle
netbox
nornir
netconf
evtx
xml
html
playbook
func
difflib