0

Trying to get OSMnx into jupyter conda environment. But conda environment not set correctly.

On command line:

  1. Created conda environment using OSMnx installation steps
  2. I cloned the environment to rename it 'realestate'
  3. Added realestate to Jupyter:
> conda activate realestate
> conda install -c anaconda ipykernel
> python -m ipykernel install --user --name=realestate
> which python
/opt/anaconda3/envs/realestate/bin/python

On Jupyter the realestate environment shows up... but when I run

!which python

I get

/opt/anaconda3/bin/python

I've created some conda environments inside of Jupyter(Conda) and they show up as

Python [conda env: otherenv]

that then produces right path

!which python
/opt/anaconda3/envs/otherenv/bin/python

What am I missing?

PS. OSMnx install is not a simple conda install

conda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority osmnx
frankr6591
  • 1,211
  • 1
  • 8
  • 14

1 Answers1

1

From what I can tell, it sounds like you're trying to have OSMnx, Jupyter, and all the packages in the anaconda metapackage installed together in a single conda environment. If so, just create the conda environment with all those packages in one line, then install the ipython kernelspec in it:

conda config --prepend channels conda-forge
conda create -n realestate --strict-channel-priority osmnx anaconda jupyter
conda activate realestate
python -m ipykernel install --sys-prefix --name realestate --display-name "Python (realestate)"
jupyter kernelspec list
gboeing
  • 5,691
  • 2
  • 15
  • 41