pip

Python爬虫学习教程:天猫商品数据爬虫

℡╲_俬逩灬. 提交于 2021-02-12 04:15:49
天猫商品数据爬虫使用教程 下载chrome浏览器 查看chrome浏览器的版本号,下载对应版本号的chromedriver驱动 pip安装下列包 pip install selenium pip install pyquery 登录微博,并通过微博绑定淘宝账号密码 在main中填写chromedriver的绝对路径 在main中填写微博账号密码 #改成你的chromedriver的完整路径地址 chromedriver_path = "/Users/bird/Desktop/chromedriver.exe" #改成你的微博账号 weibo_username = "改成你的微博账号" #改成你的微博密码 weibo_password = "改成你的微博密码" 效果演示图片 项目源码 # -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver import

离线安装Superset 0.37(截图详细版)

末鹿安然 提交于 2021-02-12 03:38:22
上文提到了Superset 0.37的在线安装方式,只需要更新pip,然后pip install就可以了。但是在生产环境中,特别是内网环境中,很多时候是没有外网的,这时候就需要采取离线安装的方式。 本文将详细介绍在Linux系统中离线安装Superset的全过程,并整理了安装过程中遇到的错误。 下载相关安装包 注:本文所有安装包均可以关注 “实时流式计算” 回复 “superset0916” 获取 下载好安装包以后,可以跳过本教程的所有下载步骤。 下载Superset,不要走错路,是apache-superset https://pypi.org/project/apache-superset/#files 源码包下载位置 https://downloads.apache.org/incubator/superset/0.37.0/ 在源码下有一个 requirements.txt 可以通过其下载所需依赖包 安装 Anaconda3 在安装superset之前,我们还需要一个python环境,当然也得离线安装,这里推荐使用Ananconda Anaconda是一个包含180+的科学包及其依赖项的发行版本。其包含的科学包包括:conda, numpy, scipy, ipython notebook等。 https://www.anaconda.com/products

六种酷炫Python运行进度条

半世苍凉 提交于 2021-02-12 03:14:27
大家平时比如 pip 安装包的时候,经常会出现进度条提示,Python是否能实现这样的打印? 而且他们又都是千篇一律的黑底白色,是否想过打印的炫酷一些呢? 今天给大家介绍下目前6种比较常用的进度条,让大家都能直观地看到脚本运行最新的进展情况。 1.普通进度条 2.带时间进度条 3.tpdm进度条 4.progress进度条 5.alive_progress进度条 6.可视化进度条 1.普通进度条 在代码迭代运行中可以自己进行统计计算,并使用格式化字符串输出代码运行进度。 import sys import time def progress_bar () : for i in range( 1 , 101 ): print( "\r" , end= "" ) print( "Download progress: {}%: " .format(i), "▋" * (i // 2 ), end= "" ) sys.stdout.flush() time.sleep( 0.05 ) progress_bar() 进度条1 2.带时间进度条 导入time模块来计算代码运行的时间,加上代码迭代进度使用格式化字符串来输出代码运行进度。 import time scale = 50 print( "执行开始,祈祷不报错" .center(scale // 2 , "-" )) start =

superset在Centos7的安装

风格不统一 提交于 2021-02-12 02:00:49
在centos7下安装superset 主要参考资料:https://www.jianshu.com/p/fc24955e295d 感谢博主。 在安装过程中出现以下问题: 1.在创建用户时提示出错,缺少contextlib插件。直接安装通过 2.在superset db update时出错,提示 importerror: cannot import name encryptedtype 从网页https://github.com/apache/incubator-superset/issues/4953 查询资料发现要求 SQLAlchemy-Utils <0.33,使用pip show SQLAlchemy-Utils发现版本为0.33.2 使用pip install SQLAlchemy-Utils == 0.32.0 安装后,通过。 3.在安装完成后,mapbox报错:An error occurred while rendering the visualization: Error: An API access token is required to use Mapbox GL.。查询发现需在superset的config.py中添加mapbox_api_Key。默认脚本中此值为空。进行 www.mapbox.com 注册新账号。在 https://www.mapbox

-bash: docker-compose: command not found、linux 安装 docker-compose

帅比萌擦擦* 提交于 2021-02-11 21:28:08
方式1: https://blog.csdn.net/qq_32447321/article/details/76512137 方式2: curl -L https : / / get .daocloud .io /docker /compose /releases /download / 1.22 . 0 /docker -compose - `uname -s` - `uname -m` > /usr /local /bin /docker -compose chmod +x /usr /local /bin /docker -compose 方式3: 1. 运行docker-compose 命令报错: -bash: docker-compose: command not found 2.安装: 1)先安装 pip ,检查是否已有: pip -V 报错: -bash: pip: command not found 安装 pip : yum -y install epel-release yum -y install python-pip #升级 pip install --upgrade pip 2) 安装Docker-Compose: pip install docker-compose 检查是是否成功: docker-compose -version OK 了。 -----

Python 一键转化代码为流程图

早过忘川 提交于 2021-02-11 19:10:28
Graphviz是一个可以对图进行自动布局的绘图工具,由贝尔实验室开源。我们在上次 Python 快速绘制画出漂亮的系统架构图 提到的diagrams,其内部的编排逻辑就用到了这个开源工具包。 而今天我们要介绍的项目,就是基于Python和Graphviz开发的,能将源代码转化为流程图的工具:pycallgraph。 1.准备 开始之前,你要确保Python和pip已经成功安装在电脑上噢,如果没有,请访问这篇文章: 超详细Python安装指南 进行安装。如果你用Python的目的是数据分析,可以直接安装Anaconda: Python数据分析与挖掘好帮手—Anaconda Windows环境下打开Cmd(开始—运行—CMD),苹果系统环境下请打开Terminal(command+空格输入Terminal),准备开始输入命令安装依赖。 当然,我更推荐大家用VSCode编辑器,把本文代码Copy下来,在编辑器下方的终端运行命令安装 依赖模块 ,多舒服的一件事啊: Python 编程的最好搭档—VSCode 详细指南 。 在终端输入以下命令安装我们所需要的依赖模块: pip install pycallgraph 看到 Successfully installed xxx 则说明安装成功。 macOS用户请使用brew安装: brew install graphviz

snappy-c.h: No such file or directory

允我心安 提交于 2021-02-11 17:06:11
问题 I am unable to install python-snappy with pip I have all the required packages, can someone please help me with it. # /opt/company/project/3.0.0.1/bin/pip3 install --index-url=http://pypi.company.local:9700 --trusted-host pypi.dvms.local python-snappy ...SNIP... running build_ext generating cffi module 'build/temp.linux-x86_64-3.6/snappy._snappy_cffi.c' creating build/temp.linux-x86_64-3.6 building 'snappy._snappy_cffi' extension creating build/temp.linux-x86_64-3.6/build creating build/temp

snappy-c.h: No such file or directory

风格不统一 提交于 2021-02-11 17:05:15
问题 I am unable to install python-snappy with pip I have all the required packages, can someone please help me with it. # /opt/company/project/3.0.0.1/bin/pip3 install --index-url=http://pypi.company.local:9700 --trusted-host pypi.dvms.local python-snappy ...SNIP... running build_ext generating cffi module 'build/temp.linux-x86_64-3.6/snappy._snappy_cffi.c' creating build/temp.linux-x86_64-3.6 building 'snappy._snappy_cffi' extension creating build/temp.linux-x86_64-3.6/build creating build/temp

ModuleNotFoundError: No module named 'Levenshtein'

蓝咒 提交于 2021-02-11 16:51:32
问题 I installed Levenshtein using pip and it's included in pip list packages. But when I run a python script, appears this error: ModuleNotFoundError: No module named 'Levenshtein' This is the pip list : Cython (0.29.15) docopt (0.6.2) dyNET (2.1) mosestokenizer (1.1.0) numpy (1.16.6) openfile (0.0.7) pip (9.0.1) python-Levenshtein (0.12.0) setuptools (28.8.0) toolwrapper (1.0.0) uctools (1.0.2) wheel (0.29.0) The gcc is linked to the environment variables. Any suggestions? Thanks in advance. 回答1

ModuleNotFoundError: No module named 'Levenshtein'

元气小坏坏 提交于 2021-02-11 16:51:31
问题 I installed Levenshtein using pip and it's included in pip list packages. But when I run a python script, appears this error: ModuleNotFoundError: No module named 'Levenshtein' This is the pip list : Cython (0.29.15) docopt (0.6.2) dyNET (2.1) mosestokenizer (1.1.0) numpy (1.16.6) openfile (0.0.7) pip (9.0.1) python-Levenshtein (0.12.0) setuptools (28.8.0) toolwrapper (1.0.0) uctools (1.0.2) wheel (0.29.0) The gcc is linked to the environment variables. Any suggestions? Thanks in advance. 回答1