Is path broken for anaconda ipython?

add anaconda to path
anaconda python
conda command not found windows
install conda
anaconda navigator
anaconda prompt
conda init
your shell has not been properly configured to use 'conda activate

I wish to use anaconda distribution of ipython, but typing ipython at the terminal produces an error message:

Traceback (most recent call last):
  File "/usr/local/bin/ipython", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: ipython==0.13.1

Adding PATH to .bash_profile as below produces the same error message. Asking which python produces //anaconda/bin/python, and which ipython produces /usr/local/bin/ipython. How can I fix this such that ipython launches anaconda ipython?

# MacPorts Installer addition on 2012-11-03_at_23:50:01: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
# Add colors to terminal
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad

# added by Anaconda 1.6.1 installer
export PATH="//anaconda/bin:$PATH"
export PATH=/anaconda//bin/isympy:$PATH

# added to Homebrew: bad command
export PATH=/usr/local/bin:$PATH

Update: I updated anaconda and ipython using conda update as suggested, but still get the same error message.

Update 2: Thanks for all the suggestions. I modified /usr/local/bin/ipython as follows:

#!//anaconda/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'ipython==1.1.0','console_scripts','ipython'
__requires__ = 'ipython==1.1.0'
import sys
from pkg_resources import load_entry_point

sys.exit(
   load_entry_point('ipython==1.1.0', 'console_scripts', 'ipython')()
)

Now which ipython produces //anaconda/bin/ipython, and ipython launches.

One possible reason is that there are multiple ipython versions installed e.g., brew might install to /usr/local/bin, conda might install to /anaconda/bin (it is just a guess). The advice from similar issue is to remove all ipython installation completely and install the one that you will use.

Managing Python, =3.6 is the package and version you want to install in this new environment. This could be any package, such as numpy=1.7 , or multiple packages. This path varies according to which operating system version and which Anaconda version you use, so you will need to search your file system to find the correct path to your Python interpreter. You can search for the Python interpreter with your operating system’s file manager, such as File Explorer on Windows, Finder on macOS, or Nautilus on Ubuntu Linux.

Your problem is in your $PATH. If you look at your traceback, it's running /usr/local/bin/ipython - this is the one that is installed by Homebrew, and not by Anaconda. (Anaconda installs everything into /anaconda/bin.)

The reason this is getting picked up is because the very last line of your .bash_profile sticks /usr/local/bin at the front of your path. This means that the ipython that you installed via Homebrew is masking the one that's installed by Anaconda.

You have two options:

  1. Uninstall the ipython that Homebrew installed, and just use Anaconda for your Python packages.

  2. In your .bash_profile, move the Homebrew PATH modification line above the Anaconda one. This way, Anaconda's ipython, python, and various other Python commands will take precedence.

Remember, if you change your .bash_profile, you need to close your Terminal and start a new one for the changes to take effect.

Common installation problems, Clear all PATHs related to Python in sysdm.cpl file. Delete any previously The conda shell function is not available, or is not working properly. Some causes:. IPython now includes a version of pexpect in IPython.external, but if you have installed pexpect, IPython will use that instead. And that seems somehow to fail. This comment has been minimized.

It looks like your path is completely ok. Notice that the error comes from "/usr/local/bin/ipython". It is not a bash error, it is more likely an error involving setup_tools, or pip, that is Python packaging tools. Bash finds ipython and executes ipython startup file but encounters an error there.

The error appears to be saying that your version of ipython is incompatible. Have you tried doing something like this?

 conda update conda
 conda update ipython

Updaing conda and ipython is recommended in iPython documentation. Perhaps this will fix the problem. If not, then add an information saying that you updated conda and ipython to your question.

Troubleshooting, Issue Type: Bug When the Anaconda / Miniconda python distribution is installed with an installer of the current version on Windows, the conda  To install this package with conda run one of the following: Description. IPython provides a rich architecture for interactive computing with a powerful interactive shell, a kernel for Jupyter, high performance tools for parallel computing, and more.

Ensure you check the path to the Python executable specified at the start of the script. When I installed iPython it was defined as:

#!/usr/bin/python

Instead of:

#!/usr/local/bin/python

Hence the default OS X install of Python was being used instead of my brew installed version.

Conda command broken for new anaconda python installations , Tab completion for paths within strings seems to be broken again (previously noted many Issue remains in IPython 7.7.0 installed via conda: Now let’s try adding this path to IPython’s sys.path. Temporary solution If a path exists in Python but is missing in IPython, you can temporarily add the corresponding path to IPython using sys.path.append .

For me was slightly different because even with Anaconda installed wasn't able to find the command or to run ipython and wasn't able to find the PATH. My solution was to run these commands:

nano ~/.bash_profile
export PATH="/anaconda3/bin:$PATH"
source ~/.bash_profile

and then to check conda version:

conda

and I update conda and ipython running:

conda update conda
conda update ipython

Hope this could help someone. This helped me: https://stackoverflow.com/a/49925193/3351569

Tab completions for paths broken again in 7.2.0 · Issue #11530 , This tutorial is split into three sections. The first part is installing Anaconda. The second part is testing your installation (making sure conda works, dealing with path  The IPython directory¶ IPython stores its files—config, command history and extensions—in the directory ~/.ipython/ by default. IPYTHONDIR¶ If set, this environment variable should be the path to a directory, which IPython will use for user data. IPython will create it if it does not exist.--ipython-dir=<path>¶

Install Python on Windows (Anaconda) - Michael Galarnyk, If Jupyter gives an error that it can't find notebook , check with pip or conda that the notebook package is installed. Try running jupyter-notebook (with a hyphen). I am getting started with Python¶. For new users who want to install a full Python environment for scientific computing and data science, we suggest installing the Anaconda or Canopy Python distributions, which provide Python, IPython and all of its dependences as well as a complete set of open source packages for scientific computing and data science.

What to do when things go wrong, CondaVerificationError: The package for ipython located at D:\Anaconda\pkgs\​ipython-7.1.1-py36h39e3cac_0 appears to be corrupted. The path '  Currently, if you update path.py to the latest release it no longer works with pickleshare. In particular, when running ipython you may receive this error: Traceback (most recent call last): File &

Conda Verification Failed, A Python environment is a context in which you run Python code and includes global, virtual, and conda environments. An environment  different Jupyter python path (installed by anaconda) - anaconda_jupyter.md

Comments
  • Do you have the PYTHONPATH environment variable set?