jupyter / help

:sparkles: Need some help or have some questions? Please visit our Discourse page.
https://discourse.jupyter.org
291 stars 97 forks source link

Package requires `jupyter`, but setuptools only knows about `jupyter_core` et al. in distribution #440

Open tim-tx opened 5 years ago

tim-tx commented 5 years ago

I have a package that uses setuptools and specifies in setup.py the line install_requires=['scipy', 'matplotlib', 'numpy', 'graphviz', 'progressbar2', 'jupyter'],. The package installs a script that has in it

__requires__ = 'my_pkg==1.1'
import re
import sys
from pkg_resources import load_entry_point

which fails with pkg_resources.DistributionNotFound: The 'jupyter' distribution was not found and is required by my_pkg.

My distribution has a meta-package called jupyter that pulls in jupyter_core, jupyter_client, jupyter_console, ipython, and others. The plain "jupyter" package installs no files to the system, and no packages end up installing any files or folders with a name like jupyter-<version>-{egg,dist}-info into my system-wide site-packages directory, and as far as I can tell this is what pkg_resources needs.

  1. If I do a pip install --user jupyter I end up with ${HOME}/.local/lib/python3.7/site-packages/jupyter-1.0.0.dist-info and the DistributionNotFound error goes away.
  2. Likewise if I copy that dist-info directory to my system-wide site-packages and then do pip uninstall jupyter, the error does not appear.
  3. If I have no directory like jupyter-<version>-{egg,dist}-info at the system or local level and replace the jupyter with jupyter_core in setup.py, I do not see an error.

Is a package that requires jupyter misconfigured? Should it be asking for jupyter_core? Or is this an issue with my distribution's packaging? If it helps, the installed and up-to-date version numbers with my distribution's jupyter packages are:

jupyer 4.1.0-6
jupyter_console 5.2.0-2 
python-jupyter_core 4.4.0-4
python-jupyter_client 5.2.3-1
python-qtconsole 4.4.1-1
minrk commented 5 years ago

jupyter is a metapackage that requires all of Jupyter (qtconsole, notebook, etc.). It is unlikely that any package should have a direct dependency on it.

If jupyter appears to not be installed, it is likely a problem with the installation system, and how the jupyter package was installed int he first place.