![install ipython 6.2.1 install ipython 6.2.1](https://image.slidesharecdn.com/aipython-190807181617/95/python-code-for-articial-intelligence-foundations-of-computational-agents-7-638.jpg)
(This is because sys.path can contain the same value more than once, and the entries attribute should be able to reflect this.) entry is always appended to the entries attribute, even if it is already present, however.
![install ipython 6.2.1 install ipython 6.2.1](https://assets.digitalocean.com/articles/jupyter_notebook/create_python2_notebook.png)
This method uses find_distributions(entry,True) to find distributions corresponding to the path entry, and then add() them. This method is also called by the WorkingSet() constructor during initialization. You should use this when you add additional items to sys.path and you want the global working_set to reflect the change. It turned out that by the time that the script in this gist was called, pkg_resources had already been imported (at least once) before.Īdd a path item to the entries, finding any distributions on it. > 867 raise DistributionNotFound(req, requirers)ĭistributionNotFound: The 'numpy' distribution was not found and is required by the application ~/.pyenv/versions/3.6.1/envs/jupyter3_install/lib/python3.6/site-packages/pkg_resources/_init_.py in resolve(self, requirements, env, installer, replace_conflicting, extras)Ĩ66 requirers = required_by.get(req, None) > 981 needed = self.resolve(parse_requirements(requirements)) ~/.pyenv/versions/3.6.1/envs/jupyter3_install/lib/python3.6/site-packages/pkg_resources/_init_.py in require(self, *requirements)ĩ79 included, even if they were already activated in this working set. > 436 return working_set.find(moduleOrReq) or require(str(moduleOrReq))
![install ipython 6.2.1 install ipython 6.2.1](https://i.stack.imgur.com/q1Nqv.jpg)
~/.pyenv/versions/3.6.1/envs/jupyter3_install/lib/python3.6/site-packages/pkg_resources/_init_.py in get_provider(moduleOrReq)Ĥ34 """Return an IResourceProvider for the named module or requirement"""Ĥ35 if isinstance(moduleOrReq, Requirement): ~/.pyenv/versions/3.6.1/envs/jupyter3_install/lib/python3.6/site-packages/pkg_resources/_init_.py in get_distribution(dist)ĥ63 if not isinstance(dist, Distribution):ĥ64 raise TypeError("Expected string, Requirement, or Distribution", dist) > 1 _version_ = get_distribution('numpy').version In : _version_ = get_distribution('numpy').versionĭistributionNotFound Traceback (most recent call last) In : from pkg_resources import get_distribution IPython 6.2.1 - An enhanced Interactive Python. Type 'copyright', 'credits' or 'license' for more information I started running into some issues with packages that used get_distribution from pkg_resources (in setup tools) in their _init_.py files. I was following your Medium post to get something setup on my machine. Msg = 'Virtualenv site-packages discovery went wrong for %r' % repr() join( virtualenv, 'lib', version, 'lib-dynload') join( virtualenv, 'lib', version, 'site-packages') Resources so it can work with as many Python versions as possible. This module fixes it looking for the actual directories. IPython can detect virtualenv's path and injects it's site-packages dirs into sys.path.īut it can go wrong if IPython's python version differs from VIRTUAL_ENV's. """IPython startup script to detect and inject VIRTUAL_ENV's site-packages dirs. Learn more about bidirectional Unicode characters
![install ipython 6.2.1 install ipython 6.2.1](https://i.ytimg.com/vi/vpgNnuPLam4/maxresdefault.jpg)
To review, open the file in an editor that reveals hidden Unicode characters. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below.