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

Trouble installing with pip: pkg_resources.DistributionNotFound: The 'Mathics3<7.1.0,>=6.2.0' distribution was not found and is required by mathicssript #75

Open
anandijain opened this issue Oct 2, 2023 · 1 comment

Comments

@anandijain
Copy link

anandijain commented Oct 2, 2023

Hello, thank you for the great work!
I'm trying to follow https://mathics-development-guide.readthedocs.io/en/latest/installing.html

I am using Ubuntu 22.04 in windows subsystem for linux. I ran the apt install commands as root, and I didn't see any issues, (except for a minor complaint about python-dev not being found, so I just omitted it).

However, when attempting to pip install mathics with pip install Mathics-omnibus[full] or pip install Mathics-omnibus I get the following error when I go to run mathicsscript from the command line:
pkg_resources.DistributionNotFound: The 'Mathics3<7.1.0,>=6.2.0' distribution was not found and is required by mathicsscript

here is information about my python version:

anand@Suds-Vostro ~/dev> pip -V
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
Full error:
anand@Suds-Vostro ~/dev> mathicsscript
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
  warnings.warn(
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 573, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 891, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 782, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (mathicsscript 6.0.0 (/home/anand/.local/lib/python3.10/site-packages), Requirement.parse('mathicsscript==7.0.0.dev0'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/mathicsscript", line 33, in <module>
    sys.exit(load_entry_point('mathicsscript==7.0.0.dev0', 'console_scripts', 'mathicsscript')())
  File "/usr/local/bin/mathicsscript", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/anand/.local/lib/python3.10/site-packages/mathicsscript/__main__.py", line 12, in <module>
    from mathics import license_string, settings, version_info
  File "/home/anand/.local/lib/python3.10/site-packages/mathics/settings.py", line 7, in <module>
    import pkg_resources
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3267, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3241, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3279, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 575, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 588, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 777, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'Mathics3<7.1.0,>=6.2.0' distribution was not found and is required by mathicsscript

Manually specifying versions, it seems like no version greater than 6.0.2 could be found by pip

anand@Suds-Vostro ~ [1]> pip install 'Mathics3>=6.2.0,<7.1.0' --upgrade
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement Mathics3<7.1.0,>=6.2.0 (from versions: 1.1.0, 1.1.1, 2.0.0, 2.1.0, 2.2.0, 3.0.0, 3.1.0, 4.0.0, 5.0.0, 5.0.1, 5.0.2, 6.0.0, 6.0.1, 6.0.2)
ERROR: No matching distribution found for Mathics3<7.1.0,>=6.2.0
@rocky
Copy link
Member

rocky commented Oct 7, 2023

Sorry for the delay. I just had a chance to look at now.

Basically the situation for mathics-omnibus is that right now (and probably for a long time to come) you either need to install everything from github sources, or from PyPI but not mix these two.

The longer story is that right now and our API keeps changing between releases and probably will continue to do so for a little big. I will update the readthedocs documentation to make this clearer.

I just tried installing from PyPI on (Ubuntu 23.0.4 rather than 22.04) and this worked for me. See attached log:
omnibus-install.txt

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

2 participants