![](https://img-blog.csdnimg.cn/20200429210727613.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
python
python
Jack Mai
Stay hungry.
展开
-
Python2.7和Python3.6共存的环境中,如何使用 Python 3.6 的 pip 安装其他包(如scikit-learn)
在开发环境中同时安装多个 Python 版本是一种常见的情况,本文将介绍在Python2.7和Python3.6共存的环境中,如何使用 Python 3.6 的 pip 安装其他包(如scikit-learn)。原创 2024-04-10 09:12:32 · 372 阅读 · 0 评论 -
Django错误解决:django.core.exceptions.AppRegistryNotReady: Models aren‘t loaded yet.
打算用Django连接MongoDB,于是尝试了一下Djongo,按照官方示例直接将下面的代码照抄到models.py,执行makemigrations时报错:django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet. 解决方案如下原创 2023-01-27 12:57:39 · 1318 阅读 · 0 评论 -
pytest+selenium自动化测试知识汇总
pytest+selenium自动化测试知识汇总原创 2022-12-30 11:39:31 · 785 阅读 · 0 评论 -
python的numpy库常用函数
transpose_B = np.transpose(array_B) ##矩阵?转置mat_product_AB = np.dot(array_A, transpose_B) ##矩阵点乘np.max(a,axis=1) ##求每行的最大值原创 2018-11-16 18:55:35 · 327 阅读 · 0 评论 -
【Python】获取当前北京时间
服务器的当地时间可能不是北京时间,因此要实现时区转换。首先要引入```pytz```模块:```pip install pytz``````python#!/usr/bin/env python# -*- coding:utf-8 -*-# Author: wxnacy(wxnacy@gmail.com)import timefrom datetime import datetimeimport pytztz = pytz.timezone('Asia/Shanghai') #东八转载 2019-05-03 12:56:11 · 5451 阅读 · 0 评论 -
Python解析库BeautifulSoup笔记:将bs4.element.Tag转换成string
用BeautifulSoup提取出dd标签后,想要用正则表达式将标签内的双引号的内容取出来,因此想将bs4.element.Tag转换成string。转换方式:使用str()进行强制转换(Python真香!)参考资料:https://stackoverflow.com/questions/20968562/how-to-convert-a-bs4-element-resultset-to-...原创 2019-05-03 12:11:44 · 36584 阅读 · 0 评论 -
错误解决:Could not find a version that satisfies the requirement h5py (from keras) (from versions: )
执行命令:pip3.7 install keras报错:Could not find a version that satisfies the requirement h5py (from keras) (from versions: ) No matching distribution found for h5py (from keras)解决方法:更新pip后,再试一次pip3.7 i...原创 2019-04-23 20:25:24 · 22100 阅读 · 6 评论 -
Mac环境下jupyter notebook的安装和使用
进入控制台使用以下命令进行安装:pip install --upgrade pippip install jupyter然后输入python -m IPython notebook即可自动打开浏览器的8888端口进入jupyter notebook的页面:参考资料:https://www.jianshu.com/p/cb9c3b301f3e...原创 2019-04-23 14:54:36 · 4277 阅读 · 0 评论 -
错误解决:pip install --upgrade pip, Could not install packages due to an EnvironmentError
使用命令:pip install --upgrade pip发生错误:Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip-18.1.dist-info/INSTALLER'Consider usin...原创 2019-04-23 14:40:04 · 1675 阅读 · 0 评论 -
解决pycharm报错:module 'pip' has no attribute 'main'
在使用pycharm安装matplotlib库的时候出现报错 module ‘pip’ has no attribute ‘main’,解决方法:1.在安装目录下找到 helpers/packaging_tool.py文件。2.找到函数do_install(pkgs)和do_uninstall(pkgs)3.使用以下代码替换这两个函数:def do_install(pkgs): t...原创 2018-11-11 21:14:16 · 284 阅读 · 0 评论