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

Conda dependencies different from pip? #1

Closed
mrclary opened this issue Apr 29, 2022 · 6 comments
Closed

Conda dependencies different from pip? #1

mrclary opened this issue Apr 29, 2022 · 6 comments

Comments

@mrclary
Copy link

mrclary commented Apr 29, 2022

@impact27, I noticed that applaunchservices installed from pip shows it has a dependency pyobjc but this is not a dependency in conda. conda tree shows only python as a dependency. This has piqued my curiosity since I can launch Spyder from an editable install from a pyenv virtual environment, but not from a conda environment. When attempting to do so, I get the following error (see also spyder-ide/spyder#17408 (comment)):

Traceback
Traceback (most recent call last):
  File "/Users/rclary/opt/miniconda3/envs/spy-dev/bin/spyder", line 33, in <module>
    sys.exit(load_entry_point('spyder', 'gui_scripts', 'spyder')())
  File "/Users/rclary/opt/miniconda3/envs/spy-dev/bin/spyder", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/Users/rclary/opt/miniconda3/envs/spy-dev/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/Users/rclary/opt/miniconda3/envs/spy-dev/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 "/Users/rclary/Documents/Repos/Spyder-IDE/spyder/spyder/app/start.py", line 47, in <module>
    from spyder.utils.external import lockfile
  File "/Users/rclary/Documents/Repos/Spyder-IDE/spyder/spyder/utils/external/lockfile.py", line 31, in <module>
    from spyder.utils.programs import is_spyder_process
  File "/Users/rclary/Documents/Repos/Spyder-IDE/spyder/spyder/utils/programs.py", line 28, in <module>
    import pkg_resources
  File "/Users/rclary/opt/miniconda3/envs/spy-dev/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3260, in <module>
    def _initialize_master_working_set():
  File "/Users/rclary/opt/miniconda3/envs/spy-dev/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
    f(*args, **kwargs)
  File "/Users/rclary/opt/miniconda3/envs/spy-dev/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3272, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/Users/rclary/opt/miniconda3/envs/spy-dev/lib/python3.10/site-packages/pkg_resources/__init__.py", line 581, in _build_master
    ws.require(__requires__)
  File "/Users/rclary/opt/miniconda3/envs/spy-dev/lib/python3.10/site-packages/pkg_resources/__init__.py", line 909, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Users/rclary/opt/miniconda3/envs/spy-dev/lib/python3.10/site-packages/pkg_resources/__init__.py", line 795, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pyobjc' distribution was not found and is required by applaunchservices

What don't I understand?

@impact27
Copy link
Owner

This is interesting, you need access to the objective c functions for applaunchservices to work. This must be a problem with the conda file. I will have a look next week. But maybe it was renamed pyobjc-core? https://anaconda.org/conda-forge/pyobjc-core

@mrclary
Copy link
Author

mrclary commented Apr 29, 2022

So pip show pyobjc, where pyobjc is installed in a pip environment, shows a dependency on pyobjc-core as well as a large number of pyobjc-framework* packages. I also don't see pyobjc on any conda channels.

What is interesting is that if I install Spyder from source in a conda environment, it launches just fine; it is only if I install it in editable mode that it does not.

This works

(conda) >> pip install --no-deps .
(conda) >> spyder

This does not work

(conda) >> pip install --no-deps -e .
(conda) >> spyder

@mrclary
Copy link
Author

mrclary commented Apr 29, 2022

I'm also wondering if applaunchservices is needed at all for the standalone macOS application.

@impact27
Copy link
Owner

impact27 commented Apr 29, 2022 via email

@impact27
Copy link
Owner

Ok Now it depends on pyobjc-framework-CoreServices, but that needs to be added to conda-forge.

@mrclary
Copy link
Author

mrclary commented Jun 22, 2022

Can this issue be closed now?

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