mac使用pip3报错

ImportError: cannot import name ‘HTTPSHandler‘

解决方法


down vote


It seems your pip requires HTTPSHandler which is part of SSL library.

OSX

On OS X you should link OpenSSL during Python installation (See: #14497).

For Python 2:

brew reinstall python --with-brewed-openssl
pip install --upgrade pip

For Python 3:

brew reinstall python3 --with-brewed-openssl
pip3 install --upgrade pip

You could have multiple Python instances together, to list them run:

brew list | grep ^python

Or list your version via ls -al /usr/local/lib/python*.

参考链接:

https://stackoverflow.com/questions/20688034/importerror-cannot-import-name-httpshandler-using-pip

https://stackoverflow.com/questions/41489439/pip3-installs-inside-virtual-environment-with-python3-6-failing-due-to-ssl-modul
https://stackoverflow.com/questions/20688034/importerror-cannot-import-name-httpshandler-using-pip

pip指定pip源安装:

./obpy17/bin/pip3 install -i http://pypi.douban.com/simple/ django  --trusted-host pypi.douban.com

时间: 2024-10-13 12:58:17

mac使用pip3报错的相关文章

opencv mac macOS Sierra 报错 'QTKit/QTKit.h' file not found 解决记录

在安装opencv时如果升级了macOS Sierra可能会遇到如下错误: XXX/cap_qtkit.mm:46:9: fatal error: 'QTKit/QTKit.h' file not found #import ^ 1 error generated. make[2]: *** [modulesideoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o] Error 1 make[1]: *** [modulesideoio/CM

mac 安装mysql 报错“ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/tmp/mysql.sock' (2)” 解决办法

首先安装 homebrew 再 brew install mysql 之后连接 mysql 无论是登录还是修改初始密码都会报如下的错误 ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/tmp/mysql.sock' (2) 运行如下解决:参考 http://www.thinksaas.cn/group/topic/347978/ unset TMPDIR mysql_install_db --v

Mac编译mcrypt报错malloc.h不存在

mac下编译mcrypt的时候总是报错, 起初提示 rm: conftest.dSYM: is a directory checking if gcc supports -fno-rtti -fno-exceptions... yes checking for gcc option to produce PIC... -fno-common -DPIC checking if gcc PIC flag -fno-common -DPIC works... yes checking if gcc

Mac运行Shadowsocks报错

觉得在中国做IT挺可悲的,强大的GFW封掉了IT从业者通往Google的大门,于是大家想着各种办法去翻墙,这也养活了了一大堆卖VPN的,可怜的IT从业者们自己花钱买VPN,水平高点的自己买VPS,然后搭建VPN 服务器.种种方法但还是逃不过国家的封杀,最近最好用的GreenVPN就被无情的封掉了.于是只能再想其他方法翻GFW. 我用的是Shadowsocks,但是在运行的时候报timeout,通过system.log看到如下报错 Service only ran for 0 seconds. P

Mac下Notes报错NSSQLiteErrorDomain error 8解决方法

最近在Mac下Notes突然不能打开了,报如下错误: NSSQLiteErrorDomain error 8 这时,如果到System Preferences里,iCloud也打不开的,报错:Could not load iCloud preference pane. 打开Applications-->Utilities-->Console,看到如下类型的错误: 6/1/15 3:38:37.339 PM com.apple.NotesMigratorService[475]: SQLite:

Mac和Linux报错: dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib的解决办法

在mac系统下,执行谷歌机器学习框架 Tesseract时,报错: dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib 原因是在/usr/local/opt/jpeg/lib/路径下找不到 libjpeg.8.dylib文件. 解决方法: 以下命令按顺序在终端进行执行: 1:   wget -c http://www.ijg.org/files/jpegsrc.v8d.tar.gz2:   tar xzf jpegs

Mac打开Terminal报错-bash : : command not found

问题描述: Mac系统在打开Terminal的时候,报错-bash : : command not found. 问题分析: 报错并不影响Terminal的使用,于是忽略不计.但是在修改.bash_profile文件后,为了使配置生效,使用source命令,也是报错-bash : : command not found. 开始以为是source命令找不到,将/bin加入到环境变量中,还是报这个错误. 问题陷入困境. 在网上搜索,发现大部分问题都类似是 -bash:nginx: command n

【Django】Mac 安装pip3-install-mysqlclient 报错

1.首先在pip3-install-mysqlclient时报错 mysql_config not found 2.逛了一些博客 让安装mysql或者mysql-connector-c 我安装了后者还是报错,现在报了这个错误 File "<string>", line 1, in <module> File "/private/var/folders/2f/r1pwfcp521q7z9kd240tr3700000gn/T/pip-build-u8yhU

MAC 安装psycopg2报错ld: library not found for -lssl

pip3 install psycopg2 报错:ld: library not found for -lssl 解决参考:https://github.com/PyMySQL/mysqlclient-python/issues/169 安装前定义这两个环境变量就好了 export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include" 原文地