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

ModuleNotFoundError: No module named 'mathics_django.web.urls' #1153

Closed
FreddyBaudine opened this issue Feb 14, 2021 · 12 comments
Closed

ModuleNotFoundError: No module named 'mathics_django.web.urls' #1153

FreddyBaudine opened this issue Feb 14, 2021 · 12 comments

Comments

@FreddyBaudine
Copy link

Dear all,
After installing Mathics from github as per the instruction in
https://mathics-development-guide.readthedocs.io/en/latest/installing.html, I got the following results:

  1. mathicsscript works as designed.
  2. mathicsserver leads to a missing components, viz.,
    ModuleNotFoundError: No module named 'mathics_django.web.urls'.

As I am an end user and not a developer, I can't make anything of the bunch of messages generated while running mathicsserver. Here they are:
`
C:\Users\Freddy>mathicsserver
Migrating database C:/Users/Freddy/AppData/Roaming/Python/Mathics/mathics.sqlite
Traceback (most recent call last):
File "C:\Users\Freddy\AppData\Local\Programs\Python\Python38\Lib\site-packages\mathics_django\mana
ge.py", line 14, in
execute_from_command_line(sys.argv)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\managem
ent_init_.py", line 401, in execute_from_command_line
utility.execute()
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\managem
ent_init_.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\managem
ent\base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\managem
ent\base.py", line 371, in execute
output = self.handle(*args, **options)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\managem
ent\base.py", line 85, in wrapped
res = handle_func(*args, **kwargs)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\managem
ent\commands\migrate.py", line 75, in handle
self.check(databases=[database])
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\managem
ent\base.py", line 392, in check
all_issues = checks.run_checks(
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\checks
registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\checks
urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\checks
urls.py", line 23, in check_resolver
return check_method()
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\urls\resolve
rs.py", line 408, in check
for pattern in self.url_patterns:
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\utils\functi
onal.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\urls\resolve
rs.py", line 589, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\utils\functi
onal.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\urls\resolve
rs.py", line 582, in urlconf_module
return import_module(self.urlconf_name)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\importlib_init_.py", line 127,
in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in call_with_frames_removed
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\mathics_django\urls
.py", line 14, in
url(r'^', include('mathics_django.web.urls')),
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\urls\conf.py
", line 34, in include
urlconf_module = import_module(urlconf_module)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\importlib_init
.py", line 127,
in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mathics_django.web.urls'
error: failed to create database

C:\Users\Freddy>`

Unless I've made any mistake, is there either a workaround or a fix available?
Many thanks.
Regards,
Freddy

@mmatera
Copy link
Contributor

mmatera commented Feb 14, 2021

This error is due to a mismatch between versions of the different parts of Mathics. In the course of the week, we expect to release a new version of all the parts of Mathics, which shouldn't generate this kind of errors.

@FreddyBaudine
Copy link
Author

Hi Juan Mauricio,
Many thanks for your quick reply, I trust you're right.
The thing is that when the latest version is out, I haven't a clue as to how to upgrade the installed version on my machine, that is, download what, where and how. Is it going to be kind of automatic through using the command 'pip install ...' or will I have to uninstall everything first?
Regards,
Freddy

@mmatera
Copy link
Contributor

mmatera commented Feb 14, 2021

@FreddyBaudine, indeed, this is something that we are trying to fix in this new release. Previous versions of Mathics were monolithic, so if you just downloaded the project from github, all the parts were updated at a time. However, as the project grows, the system becomes more and more complicate to test and maintain. This is why the development team decides to split the project in smaller and more stable parts. However, this decision requires time for implementing certain adjustments. Please have a little of patience...

@FreddyBaudine
Copy link
Author

Hi Juan Mauricio,

By trial and error I succeeded in getting the full complement of Mathics installed and running. In fact, I first uninstalled Mathics-Django which I had first installed from github, then used the command pip install Mathics-Django from the site https://pypi.org/project/Mathics-Django/ to re-install it. It seems that I may have found the right match out of the mismatch between the different parts of Mathics you mentioned in a previous post for this application to work.
This much allows me to move on for I am helping students with their maths and physics.
Everything seems to work as expected except for the 2D plots for which the tick marks of the two axes are not labelled at all.
Agreed, on the site mentioned above the screen shot of the 2D pictured there does not have tick marks of the axes labelled either.
This state of affairs does not occur with 3D plots, tick marks of the three axes are properly labelled.
Is there a way to get these axes tick marks labelled for 2D plots? I was not able to find any instruction regarding this in the pdf file Mathics 2.0.0 dated from February 14, 2021.

Your input in this regard is most needed. Many thanks in advance for your help.
Regards,
Freddy

@rocky
Copy link
Member

rocky commented Feb 16, 2021

Agreed, on the site mentioned above the screen shot of the 2D pictured there does not have tick marks of the axes labelled either.

We've known about this for a while. See #1078, and we have been working on it. In fact PR #635 goes back 5 years, although this has been broken forever. (Not implemented features is a default behavior.)

Our challenge isn't finding problems. It is finding people who are willing to spend the time to fix the problems. I mean here programmers who don't need to be told how to build a Python package, and aren't phased when they hit a Python traceback and can read a Python traceback and start troubleshooting, fix the code, and submit a Pull Request. If this isn't you, then consider using the docker images, or older released packages like Conda-forge or https://repology.org/project/mathics/versions.

However, for now if you want the cutting-edge edge code, you may get cuts.

If you are looking for a more polished program, obviously there is Mathematica. It has a lot more features too.

As for the brokenness in building from development: the problem there is that there is a large bit of restructuring that needs to go on at least so I can be able to wrap my hands around this project, expand and improve it. The fact that we went from 1.x to 2.0 is a reflection of this. See the beginning of the 2.0.0 Release notes https://github.com/mathics/Mathics/releases and also the beginning of 1.1.1 release notes. I'll revise this at some point to mention the instability.

Unfortunately the 2.0.0 release could and should have happened a month earlier. If it had, fewer people would have run into the "module not found" issue. This is caused by a mismatch between using development versions with the latest released versions because released versions because these are incompatible. Because it didn't happen sooner, the window of people falling into this was more larger.

And even now after the 2.0.0 release, I see there are still lingering but small problems especially in the Django front end which we'll address down the line as we get spare time to address. (Again if you use the docker image this isn't a problem.)

@FreddyBaudine
Copy link
Author

Hi Rocky,

Thanks for your reply which, I have to say, put me somewhat ill at ease as I felt guilty for making use of your software. Clearly, your prose indicates you must somehow be on edge and under pressure. In my post, I was just asking a question and, with respect, there is no reason to get on one's high horses.

I am a mathematician (retired) not an IT person. I understand that with that quality I can't be of much help to you except, possibly, as a tester. I truly recognise the tremendous amount of work that this development represents for you and your team. That being said, I trust you're endeavouring to do so for your users. Otherwise, what the heck is there for putting so much energy in this enterprise of yours.

I was seduced by Mathics as it sounded as a credible alternative to - a lighter and hence quicker to learn than - Mathematica, which is a pricey proprietary software.
May be you have advertised too soon. We are just end users who happen to come across to too much hype and follow the instructions therein. Thus, we run the risk of wanting the bleeding edge and possibly getting cuts in the process.

Keep up with the good job.

Regards,
Freddy

@mmatera
Copy link
Contributor

mmatera commented Feb 16, 2021

Dear Freddy,

the issue with the (2D) graphics is due to a change in the standard of one of the libraries we use to render in the graphics interface (to be precise, MathML)
We are working on a patch to having graphics functional again, but with didn't make it finishing before the release. The idea of this release was to finishing with the mess of dependencies you detected at the beginning of this issue. I hope we have, in a couple of months, a new release with full support for graphics.

Kind regards,
Mauricio

@mmatera
Copy link
Contributor

mmatera commented Feb 16, 2021

BTW, thanks for checking the installation process in your system. Rocky was working a lot to put all the pieces together, and now we need to check how robust is the new system.

@rocky
Copy link
Member

rocky commented Feb 16, 2021

Hi Rocky,

Thanks for your reply which, I have to say, put me somewhat ill at ease as I felt guilty for making use of your software.

Sorry, that wasn't my intention.

Clearly, your prose indicates you must somehow be on edge and under pressure. In my post, I was just asking a question and, with respect, there is no reason to get on one's high horses.

Again, sorry - that was not my intention.

I am a mathematician (retired) not an IT person. I understand that with that quality I can't be of much help to you except, possibly, as a tester.

Here, as a general rule, I would suggest that before reporting a problem, look at the already opened problems. It can also help you gauge the state of the project.

I truly recognise the tremendous amount of work that this development represents for you and your team.

In the open source world, you should think or consider yourself as part of the "team". (I have found when people are asked to contribute, in whatever way that is within their means, it seems to adjust their expectations on how fast something might get done.)

I was seduced by Mathics as it sounded as a credible alternative to - a lighter and hence quicker to learn than - Mathematica, which is a pricey proprietary software.
May be you have advertised too soon. We are just end users who happen to come across to too much hype and follow the instructions therein.

One way that you can help is that when you find documentation or instructions that are misleading or wrong, feel free to submit changes. There are wikis in many of the repositories that anyone can edit. However the development guide for the docs are in its own repository https://github.com/Mathics3/mathics-development-guide and the source to the mathics.org website is also in a github repostitory: https://github.com/mathics/mathics.github.io

You can read about the github collaboration system here.

@mmatera
Copy link
Contributor

mmatera commented Feb 16, 2021

So, in a resume, I guess this issue can be closed. The graphics issues are mentioned in Issue #1078, which I hope get solved soon.

@mmatera mmatera closed this as completed Feb 16, 2021
@FreddyBaudine
Copy link
Author

Hi Mauricio,

You closed this issue a bit too soon for I had hoped, in answering your before last post, to thank you for your invitation to go on testing your software on my system (Windows 7 Professional, Service Pack 1, 64-bit).
I'm probably going to get Rocky's wrath again in reporting here what I have just found.

After launching mathicsserver.
I wanted to test how 'saving worksheet' and 'openworksheet' worked.
Alas, no saving took place and I got the following error: TypeError: 'bool' object is not callable
All the details are in the dump below.

`C:\Users\Freddy\Desktop\Mathics\Mathics3>C:\Users\Freddy\AppData\Local\Programs\Python\Python38\Scripts\mathic
sserver.exe
Migrating database C:/Users/Freddy/AppData/Roaming/Python/Mathics/mathics.sqlite
Operations to perform:
Apply all migrations: auth, contenttypes, sessions, sites, web
Running migrations:
No migrations to apply.

database initialized sucessfully

Django front end version 2.0.1.dev
Mathics 2.0.0
on CPython 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)]
using SymPy 1.7.1, mpmath 1.1.0, django 3.1.6

Copyright (C) 2011-2021 The Mathics Team.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
See the documentation for the full license.

Quit by pressing CTRL-BREAK

Open the graphical user interface at
http://localhost:8000
in Firefox, Chrome, or Safari to use Mathics

[16/Feb/2021 16:42:19] "GET / HTTP/1.1" 200 9771
[16/Feb/2021 16:42:58] "POST /ajax/query/ HTTP/1.1" 200 371
[16/Feb/2021 16:42:58] "GET /media/js/mathjax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Regular/Other.js HTTP/1.
1" 304 0
[16/Feb/2021 16:43:09] "GET /ajax/doc/ HTTP/1.1" 200 7044
Internal Server Error: /ajax/save/
Traceback (most recent call last):
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\handlers\exceptio
n.py", line 47, in inner
response = get_response(request)
File "c:\users\freddy\appdata\local\programs\python\python38\lib\site-packages\django\core\handlers\base.py"
, line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "c:\users\freddy\mathics-django\mathics_django\web\views.py", line 287, in save
if not user.is_authenticated():
TypeError: 'bool' object is not callable
[16/Feb/2021 16:46:39] "POST /ajax/save/ HTTP/1.1" 500 70126`

Shall I have to open a new issue?
Regards,
Freddy

@mmatera
Copy link
Contributor

mmatera commented Feb 16, 2021

Hi again,
yes: this is an issue in mathics-django. Would you be so kind of reporting this in a new issue on
https://github.com/Mathics3/mathics-django/issues
?
Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants