When I run !pip install geocoder
in Jupyter Notebook I get the same output as running pip install geocoder
in the terminal but the geocoder package
! pip install --user <package>
The !
tells the notebook to execute the cell as a shell command.
%pip install fedex #fedex = package name
in 2019.
In older versions of conda:
import sys
!{sys.executable} -m pip install fedex #fedex = package name
*note - you do need to import sys
The problem is that pyarrow
is saved by pip
into dist-packages
(in your case /usr/local/lib/python2.7/dist-packages
). This path is skipped by Jupyter so pip
won't help.
As a solution I suggest adding in the first block
import sys
sys.path.append('/usr/local/lib/python2.7/dist-packages')
or whatever is path or python version. In case of Python 3.5 this is
import sys
sys.path.append("/usr/local/lib/python3.5/dist-packages")
Using pip2 worked for me:
!pip2 install geocoder
...
import geocoder
g = geocoder.google('Mountain View, CA')
g.latlng
[37.3860517, -122.0838511]
This worked for me in Jupyter nOtebook /Mac Platform /Python 3 :
import sys
!{sys.executable} -m pip install -r requirements.txt
In jupyter notebook under python 3.6, the following line works:
!source activate py36;pip install <...>