pip

sentry安装

*爱你&永不变心* 提交于 2021-01-05 07:34:21
Sentry 是一个开源的实时错误追踪系统,可以帮助开发者实时监控并修复异常问题。它主要专注于持续集成、提高效率并且提升用户体验。Sentry 分为服务端和客户端 SDK,前者可以直接使用它家提供的在线服务,也可以本地自行搭建;后者提供了对多种主流语言和框架的支持,包括 React、Angular、Node、Django、RoR、PHP、Laravel、Android、.NET、JAVA 等。同时它可提供了和其他流行服务集成的方案,例如 GitHub、GitLab、bitbuck、heroku、slack、Trello 等。目前公司的项目也都在逐步应用上 Sentry 进行错误日志管理。 使用 docker-compose 搭建 Sentry 本身是基于 Django 开发的,而且也依赖到其他的如 Postgresql、 Redis 等组件,所以一般有两种途径进行安装:通过 Docker 或用 Python 搭建。官网下分别有以下的两个介绍: 通过 Docker 安装 通过 Python 安装 如果你选择了通过 Docker 进行安装,其实还有更加便捷的方式 —— docker-compose 。在 github 上有一个 开源项目 用于部署 Sentry ,我们可以直接使用该项目进行部署,首先是克隆该项目: 1 git clone https://github.com

PIP Install: Cannot combine --user and --target

岁酱吖の 提交于 2021-01-04 07:53:57
问题 My goal is to install a package to a specific directory on my machine so I can package it up to be used with AWS Lambda. Here is what I have tried: pip install snowflake-connector-python -t . pip install --system --target=C:\Users\path2folder --install-option=--install-scripts=C:\Users\path2folder --upgrade snowflake-connector-python Both of these options have returned the following error message: ERROR: Can not combine '--user' and '--target' In order for the AWS Lambda function to work, I

模块—— 序列化模块、random模块、os模块 、 sys模块、hashlib模块、collections模块

不打扰是莪最后的温柔 提交于 2021-01-04 06:40:41
今天我们来说说Python中的模块: 第三方模块 可以下载/安装/使用 第一步:将pip. exe 所在的目录添加到环境变量中 第二步:输入pip 第三步:pip install 要安装的模块名称 #pip install xlrd 报错原因: 要求更新模块:python36 -m pip install --upgrade pip 安装成功不能导入:重启pycharm、重新安装 自定义模块   随着程序代码越写越多,不易维护,所以我们把函数分组,放在不同的文件中,这样每个文件的代码块就较少,一个.py文件就是一个自定义模块 第一种 直接import 这里有个大前提,就是你的py执行文件和模块同属于同个目录(父级目录),如下图: ​ 执行文件main. py 和 模块文件pwcong模块同在python目录 pwcong模块提供的函数写在 __init__. py 里,里面只提供一个 hi 函数: def hi(): print( "hi") 执行文件main. py直接import自定义模块 ​ import pwcong pwcong. hi() 第二种 通过sys模块导入 如果执行文件和模块不在同一个目录下,这时用import是找不到自定义模块的 import sys sys. path. append( r"C:\Users\Pwcong\Desktop\python")

MySQL数据库(5)- pymysql的使用、索引

跟風遠走 提交于 2021-01-03 14:24:46
一、pymysql模块的使用 1、pymysql的下载和使用 之前我们都是通过MySQL自带的命令行客户端工具mysql来操作数据库,那如何在python程序中操作数据库呢?这就需要用到pymysql模块,该模块本质就是一个套接字客户端软件,使用前需要事先安装。 1)pymysql模块的下载 pip3 install pymysql 2)pymysql模块的使用 现有数据库mydb,其中有一个userinfo表,表中数据如下: mysql> select * from userinfo; +----+------+-----+ | id | name | pwd | +----+------+-----+ | 1 | wll | 123 | | 2 | ssx | 456 | +----+------+-----+ 示例:使用Python实现用户登录,如果用户存在则登录成功,否则登录失败 import pymysql username = input( ' 请输入用户名: ' ) pwd = input( ' 请输入密码: ' ) # 1、连接 conn = pymysql.connect( host = ' 127.0.0.1 ' , port = 3306 , user = ' root ' , password = ' 123 ' , db = ' mydb ' ,

Python爬虫学习

杀马特。学长 韩版系。学妹 提交于 2021-01-03 11:27:42
原博地址:http://blog.sciencenet.cn/blog-377709-1102168.html 超级好的博主,很详细,适合零基础学习。 Anaconda 下anaconda prompt:pip install pipenv 运行完后运行: pipenv install 安装软件包requests_html:pip install requests_html 读入网页加以解析抓取,需要用到的软件包是 requests_html 。 from requests_html import HTMLSession session = HTMLSession() #建立一个会话,让python作为一个客户端,和远端服务器交谈 url = 'https://www.jianshu.com/p/85f4624485b9' #输入爬取网址 r = session.get(url) #利用 session 的 get 功能,把这个链接对应的网页整个儿取回来 print(r.html.text)#我们告诉Python,请把服务器传回来的内容当作HTML文件类型处理。我不想要看HTML里面那些乱七八糟的格式描述符,只看文字部分。 获取网页中的所有链接 把返回的内容作为HTML文件类型,我们查看 links 属性: r.html.links 注释:看似不完整的链接,是相对链接,它是某个链接

OpenStack基础知识-tox的详解介绍

感情迁移 提交于 2021-01-03 09:24:29
1、tox简介 tox是通用的虚拟环境管理和测试命令行工具。tox能够让我们在同一个Host上自定义出多套相互独立且隔离的python环境,每套虚拟环境中可能使用了不同的 Python 拦截器/环境变量设置/第三方依赖包。所以 tox 最典型的应用就是用于测试 Python 程序的兼容性了。tox是openstack社区最基本的测试工具,比如python程序的兼容性、UT等。 它的目标是提供最先进的自动化打包、测试和发布功能。 1)作为持续集成服务器的前端,大大减少测试工作所需时间; 2)检查软件包能否在不同的python版本或解释器下正常安装; 3)在不同的环境中运行测试代码。 一般 openstack 项目中的 tox 的功能包含了: 打源码包(sdist)、单元测试(UT)、测试覆盖率(coverage)、代码格式检查(pep8,flake) 等功能. 关键字解释:打源码包(sdist)、单元测试(UT)、测试覆盖率(coverage)、代码格式检查(pep8,flake) 2、使用pip方式安装tox 1)安装pip 安装epel扩展源: yum -y install epel-release 更新完成之后,就可安装pip: yum -y install python-pip 安装完成之后清除cache: yum clean all 2)安装tox $ pip

ssl not available

旧时模样 提交于 2021-01-03 08:38:54
问题 every time I try to pip install something, it says: WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken

python install wheel leads to import error

﹥>﹥吖頭↗ 提交于 2021-01-03 08:38:52
问题 I'd like to make a wheel binary distribution, intstall it and then import it in python. My steps are I first create the wheel: python ./my_package/setup.py bdist_wheel I install the wheel: pip install ./dist/*.whl I try to import the package: python -c"import my_package" This leads to the error: ImportError: No module named 'my_package' Also, when I do pip list , the my_package is listed. However, when I run which my_packge , nothing is shown. When I run pip install ./my_package/ everything

How to determine where pip3 installs binaries/scripts for non-user installs? [duplicate]

六眼飞鱼酱① 提交于 2021-01-03 07:34:04
问题 This question already has answers here : Programmatically determine pip 'user install' location Scripts directory (2 answers) Closed 2 months ago . I can determine where pip installs package binaries/scripts with pip3 install --user mypackage using: $(python3 -m site --user-base)/bin Is there a mechanism for determining where non-user binaries/scripts get installed (e.g. pip3 install mypackage ) get installed? Note that I'm only interested in where the binaries/scripts get installed and NOT

Can't install numpy - MS Visual C++ 14.1 is required. But it is installed

两盒软妹~` 提交于 2021-01-03 07:11:31
问题 I am on Windows 10 using pypy3.6-v7.3.0. I am trying to install numpy with pip install numpy , but I keep getting the error: error: Microsoft Visual C++ 14.1 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ . However I already have Visual Studio Community 2019 installed, and my C++ build tools are fully up to date. Edit: Here is the new error I am getting after installing build tools manually: Collecting numpy Using cached https://files