Details
-
Improvement
-
Status: Closed
-
Major - P3
-
Resolution: Works as Designed
-
2.3.1
-
None
-
None
-
None
-
Windows Server 2012R2
Python 3.8
Description
Hello,
I just installed motor and I was trying to connect to my mongoDB database.
I followed the example as in the documentation
import motor |
client = motor.motor_tornado.MotorClient(
|
"mongodb+srv://user:pass@127.0.0.1/test?retryWrites=true&w=majority") |
db = client.test
|
and I get the following error:
Traceback (most recent call last):
|
File "....py", line 7, in <module> |
client = motor.motor_tornado.MotorClient(
|
AttributeError: module 'motor' has no attribute 'motor_tornado' |
I think the error is catched because if i import the module
from motor import motor_tornado |
The real error appears:
Traceback (most recent call last):
|
File "C:/Users/c.galleguillos/PycharmProjects/testing/mongodb/loader.py", line 1, in <module> |
from motor import motor_tornado |
File "C:\Users\c.galleguillos\PycharmProjects\testing\venv\lib\site-packages\motor\motor_tornado.py", line 18, in <module> |
from .frameworks import tornado as tornado_framework |
File "C:\Users\c.galleguillos\PycharmProjects\testing\venv\lib\site-packages\motor\frameworks\tornado\__init__.py", line 22, in <module> |
import tornado.process |
ModuleNotFoundError: No module named 'tornado' |
I also got a missing package error of the dnspython package.
So, i think tornado and dnspython should be considered as dependencies and be specified in the install_requires keyword of the setup.py, or the error must be clear to the user.
Thanks
Attachments
Issue Links
- is related to
-
PYTHON-2640 Replace dnspython with our own SRV dns implementation
-
- Closed
-
- related to
-
PYTHON-2605 Improve mongodb+srv:// error message when dnspython is not installed
-
- Closed
-