Skip to content

Commit 9546535

Browse files
Merge branch 'master' into package_arch_refactoring
2 parents f8aced6 + 27abfe2 commit 9546535

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)