aimclub / FEDOT.Web

Graphic tool for the automated evolutionary design of composite models
https://fedot.onti.actcognitive.org
BSD 3-Clause "New" or "Revised" License
37 stars 5 forks source link

Error while initializing database by init_db.py #96

Closed hemangjoshi37a closed 1 year ago

hemangjoshi37a commented 1 year ago

Error while running: python init_db.py

Traceback (most recent call last):
  File "init_db.py", line 16, in <module>
    db = client.get_default_database()
  File "/home/hemang/anaconda3/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1948, in get_default_database
    raise ConfigurationError("No default database name defined or provided.")
pymongo.errors.ConfigurationError: No default database name defined or provided.

https://hjlabs.in

MorrisNein commented 1 year ago

Error while running: python init_db.py

Traceback (most recent call last): File "init_db.py", line 16, in db = client.get_default_database() File "/home/hemang/anaconda3/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1948, in get_default_database raise ConfigurationError("No default database name defined or provided.") pymongo.errors.ConfigurationError: No default database name defined or provided.

https://hjlabs.in

Hello, @hemangjoshi37a! Please, firstly, make sure that you have environmental variables set up according to the build instruction.

The provided error points out that you don't have MONGO_CONN_STRING="mongodb://127.0.0.1:27017/test_db?compressors=zlib" as an environmental variable.

Then, before running the script, make sure you have started your Mongo database. The following ways are possible:

  1. Windows OS:

    • cd C:\Program Files\MongoDB\Server\3.2\bin
    • mongod
  2. Linux

    • sudo service mongod start

Hope, this helps.

hemangjoshi37a commented 1 year ago

How to set anything as an environment variable?

MorrisNein commented 1 year ago

How to set anything as an environment variable?

This depends on OS that you use.

Windows power shell:

$env:VARNAME = value

Windows cmd:

export varname=value

Linux bash:

$ export VAR="my value"

hemangjoshi37a commented 1 year ago

How to set anything as an environment variable?

This depends on OS that you use.

Windows power shell:

$env:VARNAME = value

Windows cmd:

export varname=value

Linux bash:

$ export VAR="my value"

Thanks for the solution.👍