Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid IP and impossible to launch mercury run demo #89

Closed
Konsilion opened this issue Apr 24, 2022 · 10 comments
Closed

Invalid IP and impossible to launch mercury run demo #89

Konsilion opened this issue Apr 24, 2022 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@Konsilion
Copy link

Hello,

I installed mercury on my pc with the command :

pip install mercury-mljar

The installation finishes but I can't mercury run demo. The text that appears is the following:

  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\mercury.exe\__main__.py", line 7, in <module>
  File "C:\Python310\lib\site-packages\mercury\mercury.py", line 56, in main
    create_demo_notebook("demo.ipynb")
  File "C:\Python310\lib\site-packages\mercury\demo.py", line 38, in create_demo_notebook
    nbf.write(nb, f)
  File "C:\Python310\lib\site-packages\nbformat\__init__.py", line 200, in write
    fp.write(s)
  File "C:\Python310\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f680' in position 129: character maps to <undefined>

I also tried to launch the application by going to http://127.0.0.1:8000 but this site is inaccessible.

I have python 3.10.4 and windows 10.

Thanks in advance if you can help me 😃

Nicolas

@pplonski pplonski self-assigned this Apr 25, 2022
@pplonski pplonski added the bug Something isn't working label Apr 25, 2022
@pplonski
Copy link
Contributor

@Konsilion thank you for reporting the issue, I'm working on a fix!

@pplonski
Copy link
Contributor

@Konsilion there was an issue with an encoding when I create a demo file. I fixed this by setting encoding to utf-8. The new version (0.6.13) is uploaded to PyPI. You can update it will the command:

pip install -U mljar-mercury

Please let me know if it works for you. Thank you!

@Konsilion
Copy link
Author

Konsilion commented Apr 25, 2022

Hi @pplonski ,

Thank you for your involvement. I executed the order you indicated and everything went well (the update). But now I have another message and nothing starts:

Operations to perform:
  Apply all migrations: admin, auth, contenttypes, django_drf_filepond, notebooks, sessions, tasks
Running migrations:
  No migrations to apply.

199 static files copied to 'C:\Python310\Lib\site-packages\mercury\static'.
Traceback (most recent call last):
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Python310\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such column: notebooks_notebook.output

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\mercury.exe\__main__.py", line 7, in <module>
  File "C:\Python310\lib\site-packages\mercury\mercury.py", line 98, in main
    execute_from_command_line(["mercury.py", "add", run_add_notebook])
  File "C:\Python310\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "C:\Python310\lib\site-packages\django\core\management\__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python310\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Python310\lib\site-packages\django\core\management\base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "C:\Python310\lib\site-packages\mercury\apps\notebooks\management\commands\add.py", line 17, in handle
    notebook_id = self.notebook_id_available(notebook_path)
  File "C:\Python310\lib\site-packages\mercury\apps\notebooks\management\commands\add.py", line 37, in notebook_id_available
    notebook = Notebook.objects.filter(path=os.path.abspath(notebook_path)).first()
  File "C:\Python310\lib\site-packages\django\db\models\query.py", line 674, in first
    for obj in (self if self.ordered else self.order_by('pk'))[:1]:
  File "C:\Python310\lib\site-packages\django\db\models\query.py", line 280, in __iter__
    self._fetch_all()
  File "C:\Python310\lib\site-packages\django\db\models\query.py", line 1324, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "C:\Python310\lib\site-packages\django\db\models\query.py", line 51, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "C:\Python310\lib\site-packages\django\db\models\sql\compiler.py", line 1175, in execute_sql
    cursor.execute(sql, params)
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 98, in execute
    return super().execute(sql, params)
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 79, in _execute
    with self.db.wrap_database_errors:
  File "C:\Python310\lib\site-packages\django\db\utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Python310\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such column: notebooks_notebook.output

I also tried the IP address and it does not work

Nicolas

@pplonski
Copy link
Contributor

@Konsilion looks like you have some old database in the folder. You can try to manually remove the database (db.sqlite file) or start in the fresh directory.

@Konsilion
Copy link
Author

Sorry, I'm a noob... I uninstalled and reinstalled mercury but it didn't work.

What do you mean by remove old data base? Is there a command directly for the shell that I could run?

If I want 'start in the fresh directory', what should I do?

Actually I'm not sure how the mercury execution logic works...

@pplonski
Copy link
Contributor

@Konsilion Mercury is creating a local SQLite database for storing information about notebooks, tasks. Probably you have database with tables from old version (previous installation). You see the issue because there is no mechanism implemented to update the old tables in the database (sorry!).

Do you install Mercury in the virtual environment? If yes, then simply delete the old one and create a new one with fresh installation.

If you installed Mercury in the system, then maybe try to remove it pip uninstall mljar-mercury (it should delete the old local database file). Then try to install the new version pip install mljar-mercury.

@Konsilion
Copy link
Author

Don't apologize, it's great what you do and the help you give ;)

I installed mercury on the system so I uninstalled and reinstalled and same problem ...

Operations to perform:
  Apply all migrations: admin, auth, contenttypes, django_drf_filepond, notebooks, sessions, tasks
Running migrations:
  No migrations to apply.

38 static files copied to 'C:\Python310\Lib\site-packages\mercury\static', 161 unmodified.
Traceback (most recent call last):
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Python310\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such column: notebooks_notebook.output

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\mercury.exe\__main__.py", line 7, in <module>
  File "C:\Python310\lib\site-packages\mercury\mercury.py", line 98, in main
    execute_from_command_line(["mercury.py", "add", run_add_notebook])
  File "C:\Python310\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "C:\Python310\lib\site-packages\django\core\management\__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python310\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Python310\lib\site-packages\django\core\management\base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "C:\Python310\lib\site-packages\mercury\apps\notebooks\management\commands\add.py", line 17, in handle
    notebook_id = self.notebook_id_available(notebook_path)
  File "C:\Python310\lib\site-packages\mercury\apps\notebooks\management\commands\add.py", line 37, in notebook_id_available
    notebook = Notebook.objects.filter(path=os.path.abspath(notebook_path)).first()
  File "C:\Python310\lib\site-packages\django\db\models\query.py", line 674, in first
    for obj in (self if self.ordered else self.order_by('pk'))[:1]:
  File "C:\Python310\lib\site-packages\django\db\models\query.py", line 280, in __iter__
    self._fetch_all()
  File "C:\Python310\lib\site-packages\django\db\models\query.py", line 1324, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "C:\Python310\lib\site-packages\django\db\models\query.py", line 51, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "C:\Python310\lib\site-packages\django\db\models\sql\compiler.py", line 1175, in execute_sql
    cursor.execute(sql, params)
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 98, in execute
    return super().execute(sql, params)
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 79, in _execute
    with self.db.wrap_database_errors:
  File "C:\Python310\lib\site-packages\django\db\utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "C:\Python310\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Python310\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such column: notebooks_notebook.output

If I understand correctly the problem comes from django, is there an investigation track on this side?

Thanks again for your help

@Konsilion
Copy link
Author

Konsilion commented Apr 25, 2022

How can I help you to help me, I have the impression to be in a dead end...

@Konsilion
Copy link
Author

Hello ,

I uninstalled python 3.10 for python 3.8 and it works. Thanks for your help and looking forward to use Mercury 😃

Nico

@pplonski
Copy link
Contributor

@Konsilion great news! Happy that it works.

What are you going to build with Mercury? Web-app or slides? (I'm working on slides themes right now :-) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants