A
A
assainofthemist2022-04-21 15:40:07
Python
assainofthemist, 2022-04-21 15:40:07

I can't import modules for the database, what is causing the error?

When importing modules:

  1. flask_pymongo
  2. pymongo
  3. pymysql

I get this error, what is it related to?
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\pymongo\__init__.py", line 78, in <module>
    from pymongo.mongo_client import MongoClient  # noqa: F401
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\pymongo\mongo_client.py", line 59, in <module>
    from pymongo import (
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\pymongo\uri_parser.py", line 23, in <module>
    from pymongo.client_options import _parse_ssl_options
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\pymongo\client_options.py", line 24, in <module>
    from pymongo.pool import PoolOptions
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\pymongo\pool.py", line 64, in <module>
    from pymongo.ssl_support import HAS_SNI as _HAVE_SNI
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\pymongo\ssl_support.py", line 24, in <module>
    import pymongo.pyopenssl_context as _ssl
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\pymongo\pyopenssl_context.py", line 26, in <module>
    from cryptography.x509 import load_der_x509_certificate as _load_der_x509_certificate
ValueError: source code string cannot contain null bytes

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TheMade, 2022-04-22
@TheMade

from pymongo import MongoClient

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question