美文网首页
python 安装 mogondb

python 安装 mogondb

作者: 程序员乔戈里 | 来源:发表于2019-12-18 16:40 被阅读0次
pip3 install pymongo
image.png
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting pymongo
  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/pymongo/
  WARNING: Retrying (Retry(total=3, 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/pymongo/
  WARNING: Retrying (Retry(total=2, 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/pymongo/
  WARNING: Retrying (Retry(total=1, 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/pymongo/
  WARNING: Retrying (Retry(total=0, 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/pymongo/
  Could not fetch URL https://pypi.org/simple/pymongo/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pymongo/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
  ERROR: Could not find a version that satisfies the requirement pymongo (from versions: none)
ERROR: No matching distribution found for pymongo
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

这是由于网络的问题,那么就换一个国内的镜像源头

pip3 install pymongo -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

提示如下,下载是下载成功了,但是提示么有权限无法按照

Looking in indexes: http://pypi.douban.com/simple/
Collecting pymongo
  Downloading http://pypi.doubanio.com/packages/70/6d/a8da5563d9ca8cfe4786ce3aa6a74d6ab6acd2e489a842e67f070db043d4/pymongo-3.10.0-cp38-cp38-manylinux1_x86_64.whl (464kB)
     |████████████████████████████████| 471kB 17.9MB/s 
Installing collected packages: pymongo
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.8/site-packages/pymongo'
Consider using the `--user` option or check the permissions.

WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

可以看到上面的错误提示中有提示 加--user,试一下

 pip3 install pymongo -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com --user

安装成功

Looking in indexes: http://pypi.douban.com/simple/
Collecting pymongo
  Downloading http://pypi.doubanio.com/packages/70/6d/a8da5563d9ca8cfe4786ce3aa6a74d6ab6acd2e489a842e67f070db043d4/pymongo-3.10.0-cp38-cp38-manylinux1_x86_64.whl (464kB)
     |████████████████████████████████| 471kB 16.6MB/s 
Installing collected packages: pymongo
Successfully installed pymongo-3.10.0
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

最开始提示没有模块


image.png

安装成功后,程序运行出来
程序代码:

#!/usr/bin/python3
 
import pymongo
 
myclient = pymongo.MongoClient('mongodb://localhost:27017/')
 
dblist = myclient.list_database_names()
print(dbliist)

结果:

python3 test_mogondb.py 
['admin', 'config', '20190909', 'local']

参考

https://blog.csdn.net/qq_43192819/article/details/85225127

https://blog.csdn.net/dyrlovewc/article/details/53142798

相关文章

  • python 安装 mogondb

    这是由于网络的问题,那么就换一个国内的镜像源头 提示如下,下载是下载成功了,但是提示么有权限无法按照 可以看到上面...

  • mogonDB使用操作

    1.电脑本地安装mogonDB 地址:https://www.mongodb.com/download-cente...

  • Mogondb

    1.什么是[NoSQL]数据库 数据库:进行高效的、有规则的进行数据持久化存储的软件 NoSQL数据库:Not o...

  • mogondb

    Mongodb副本集副本集是什么 – MongoDB 复制是将数据同步在多个服务器的过程。 – 复制提供了数据的冗...

  • mogondb搭建

    mongodb 1 )装包 [root@host50 ~]# tar -xzf mongodb-linux-x86...

  • Windows下Python环境安装

    Python安装 Jupter Notebook安装 Python安装 Python版本3.6.4 Python安...

  • pip 安装

    python安装 python pip安装

  • Python学习第一课(安装IDE和Python3)

    Python学习第一课(安装IDE和Python3) 安装Python 安装PyCharm 1. 安装Python...

  • 001.Window下Python环境安装【Python教程】

    001.Window下Python环境安装【Python教程】 1.python版本安装 python2.7安装 ...

  • selenium学习笔记1——win10+Python+Sele

    一、安装Python 1、下载 python3.4.4 安装包,开始安装Python。 2、配置 Python 环...

网友评论

      本文标题:python 安装 mogondb

      本文链接:https://www.haomeiwen.com/subject/qkpunctx.html