Skip to content

Commit 27abfe2

Browse files
DEKHTIARJonathanluomai
authored andcommitted
pymongo import error fix (#491)
1 parent 813762b commit 27abfe2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tensorlayer/db.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
import uuid
88
from datetime import datetime
99

10-
import gridfs
11-
from pymongo import MongoClient
10+
try:
11+
import gridfs
12+
from pymongo import MongoClient
13+
except ImportError:
14+
install_instr = "Please make sure you install PyMongo with the command: pip install pymongo."
15+
raise ImportError("__init__.py : Could not import PyMongo." + install_instr)
1216

1317

1418
def AutoFill(func):

0 commit comments

Comments
 (0)