IPython in a conda environment calls the wrong python
See original GitHub issueWhen I launch ipython from within a conda environment, ipython runs the python from the base conda environment instead of the python from the current environment.
This is a recent conda installation on macOS.
(phforge-test) Antonios-MacBook-Pro:~ anto$ which python
/Users/anto/miniconda3/envs/phforge-test/bin/python
(phforge-test) Antonios-MacBook-Pro:~ anto$ which ipython
/Users/anto/miniconda3/envs/phforge-test/bin/ipython
(phforge-test) Antonios-MacBook-Pro:~ anto$ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
(phforge-test) Antonios-MacBook-Pro:~ anto$ ipython
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:52:12)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: quit()
(phforge-test) Antonios-MacBook-Pro:~ anto$
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:12 (4 by maintainers)
Top Results From Across the Web
ipython uses wrong python version with anaconda
I hadn't realized that I had to install ipython separately for the python 3.6 environment; I'd thought it was a default part of...
Read more >What to do when things go wrong - The Jupyter Notebook
Jupyter fails to start · Have you installed it? ;-) · If you're using a menu shortcut or Anaconda launcher to...
Read more >Adding Python 3 to Jupyter Notebook - Northwestern University
We're going to make a new environment called p3workshop. Do this by typing: conda create -n p3workshop python=3.7 ipykernel jupyter anaconda.
Read more >Frequently Asked Questions — Spyder 5 documentation
Q: How do I run Spyder installed in a conda environment using Anaconda Navigator ... Q: How do I install Python packages to...
Read more >5 Steps — How to add your Conda environment to ... - Medium
python -m ipykernel install --user --name=tensor_flow_env. Using the above command, I will now have this conda environment in my Jupyter notebook.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Have you done
hash -r
since entering the conda environment? Bash can cache paths to executables, so sometimes it doesn’t use the one reported bywhich
. Runninghash -r
resets the cache.I ran into this and the simple fix was:
conda install -c anaconda ipython
Calling
ipython
at the command line is going to first look in the bin folder for your conda environment but if ipython isn’t found it will fall back to/usr/local/bin
or whatever is in your path.