python 3.x 安装问题及连接oracle数据库

最近有用到python去处理一些问题,发现现在3已出来,遂用直接下3.7使用

发现问题还是有一点的

1. pip 会出现ssl问题

Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host=
'files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/bf
/5f/b574ac9f70811df0540e403309f349a8b9fa1a25d3653824c32e52cc1f28/mysql-0.0.2.tar
.gz (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FA
ILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:
1051)')))

 解决方法:pip --trusted-host pypi.python.org --trusted-host pypi.org install --trusted-host files.pythonhosted.org cx_Oracle

2. 连接数据库(oracle)时问题

  2.1 安装对应位数据且与数据库对应版本的客户端:instantclient_11_2

  2.2 将里面的oci.dll   oraocci11.dll   oraociei11.dll 三个文件复制到时 Python37\Lib\site-packages 目录下

  2.3 安装cx_Oracle:pip --trusted-host pypi.python.org --trusted-host pypi.org install --trusted-host files.pythonhosted.org cx_Oracle

posted @ 2018-12-26 15:52  lobin.tong  阅读(586)  评论(0编辑  收藏  举报