can't run "seaborn" in Jupyter Noterbook (python 2.7) - seaborn

windows 10, default path of python 2.7
I try to install with using pip install seaborn
Another method mentioned in other questions

owing to reputation, I can't comment under other answers.
I use
conda install seaborn
in command
and then import in jupyter notebook
it worked!

Related

How to update jupyterlab using conda or pip

How do you update jupyterlab using conda or pip?
I understand that conda update jupyter updates jupyter notebook (I have Anaconda), but I'm not sure this takes care of jupyterlab as well.
conda update jupyter will not automatically update jupyterlab. You have to explicitly request an update of jupyterlab:
conda update jupyterlab
You may need to specify conda-forge:
conda update -c conda-forge jupyterlab
EDIT:
Trying to update to 3.0, conda update jupyterlab did not work for me (result of jupyter lab --version still was 2.x) and when I tried to specify conda-forge or jupyterlab=3.0 the command hung for too long. I gave up after almost an hour of solving environment. The following worked for me from the Anaconda shell:
conda uninstall jupyterlab
conda install -c conda-forge jupyterlab=3
I was getting frustrated by trying to update Jupyterlab on Anaconda and failing.
Eventually I realized that this line of code works for me:
conda update --all
If you prefer using pip:
pip install --upgrade jupyterlab
Or if you'd like a specific version:
pip install jupyterlab==1.2.4
Depending on your rights, you might also need to add a --user in there:
pip install jupyterlab==1.2.4 --user
After a lot of back-and-forth with the above methods with conda, none of which worked for me to upgrade nodejs to > v14.x - below is the solution that worked for me, thanks to the link below:
conda search nodejs # Search nodejs version under conda.
conda install nodejs=14.7.0 -c conda-forge
https://www.programmersought.com/article/39027053707/
Experience has taught me, that when you need to upgrade multiple pip packages, the best way is to do it all at once (pip will find a good combination of versions and requirements).
So what I did is this.
Figure out what jupyterlab uses (your output may differ):
$ jupyter --version
Selected Jupyter core packages...
IPython : 8.9.0
ipykernel : 6.20.2
ipywidgets : 8.0.4
jupyter_client : 8.0.1
jupyter_core : 5.1.5
jupyter_server : 2.1.0
jupyterlab : 3.5.3
nbclient : 0.7.2
nbconvert : 7.2.9
nbformat : 5.7.3
notebook : 6.5.2
qtconsole : 5.4.0
traitlets : 5.8.1
Put all those in a single line and run --upgrade:
$ pip install --upgrade IPython ipykernel ipywidgets jupyter_client jupyter_core jupyter_server jupyterlab nbclient nbconvert nbformat notebook qtconsole traitlets
All went smoothly.

Issues installing Tensorflow on mac

I am following instructions from tensorflow website using virtualenv to install and having following issue when validating installation using import tensorflow as tf in python interactive shell.
Please note, I am running Python 3.7
Here are list of packages I have installed.
Can someone help?
I also tried to remove protobuf suggested by stackoverflow issue using pip uninstall protobuf, but doesn't help.
I was able to resolve above issue after some research. It looks like, tensorflow is not compatible with python 3.7 (as of July 30th 18) which is what I had installed on my computer .
Following github issue helped me resolved the issue.
I installed python 3.6.6 using pyenv and setup virtualenv. Here is what I did:
# Install python 3.3.6 and create virtualenv
$ pyenv install 3.6.6
$ pyenv virtualenv 3.6.6 tensorflow_image_recognition_3_6_6
$ pyenv activate tensorflow_image_recognition_3_6_6
# update pip
$ easy_install -U pip
#Install tensorflow
$ pip3 install --upgrade tensorflow
# Test if tensorflow is installed properly
# open python interactive shell
$ python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

How should I install keras if I have anaconda?

Which one should I use to install keras if I have anaconda?
conda install -c conda-forge keras
&
pip install --upgrade keras
Also, what is conda-forge? Why need to do it this way?
The advantages of using conda rather than pip to install packages in your Anaconda environment(s) are that:
conda should determine what dependencies your requested package has, and install those too in one operation, and
you can then keep the installed packages up to date using the conda update command:
pip, PyPI, and setuptools?
None of this is going to help with updating packages that have been
installed from PyPI via pip, or any packages installed using python
setup.py install. conda list will give you some hints about the
pip-based Python packages you have in an environment, but it won’t do
anything special to update them.
The conda-forge channel is where you can find packages that have been built for conda but are not part of the official Anaconda distribution (yet).
See answers to this question for more detail on the two options (although bear in mind some of the answers may be out of date).

How to solve theano Segmentation fault?

I am running a python file which content is:
import theano.tensor as T
This gives me a Segmentation fault.
I am using anaconda.
How can this be solved?
I had the same problem after I updated scipy from version 0.17.1 to version 0.18.0
Try to create a virtual environment with conda (from Anaconda) only for theano, with the correct versions of scipy and numpy:
conda create --name theano_env theano python=2.7
or (for python 3.5):
conda create --name theano_env theano python=3.5
It solved the problem for me.

Python Basemap Import error: "requirement already satisfied" [duplicate]

This question already has answers here:
Python basemap module impossible to import
(18 answers)
Closed 2 years ago.
What works is
import mpl_toolkits
What not works is (Import Error basemap not found)
from mpl_toolkits.basemap import Basemap
I followed the instructions here :
http://matplotlib.org/basemap/users/installing.html
Downloaded the lastest basemap*.tar.gz
I run the following commands:
Inside the geos folder
export GEOS_DIR=~/
./configure --prefix=$GEOS_DIR
make
make install
Inside the basemap folder
python setup.py install
Everything runs in sudo mode and no errors. Goes outputs no python binding but not as an error so i am not sure.
It seems not to be properly installed.
Mac Os X 10.10 Yosemite
Python 2.7.6
if i type
pip install basemap --allow-external basemap --allow-unverified basemap
Requirement already satisfied (use --upgrade to upgrade): basemap in /Library/Python/2.7/site-packages
so it is there but not importable?
What worked for me was this:
brew install gdal
For completeness, I did these things too:
conda install basemap
But this should be similar to your pip install method above.
Also, for completeness, I added this line to my .bash_profile:
export GEOS_DIR=/usr/local/Cellar/geos/3.4.2/
You may need to edit the version number.
Then, you can run:
from mpl_toolkits.basemap import Basemap
The easiest way to install basemap on OS X is to use Ports.
Just type in the below command and the see the magic unfold:
port install py-matplotlib-basemap
Correct me if I am wrong. Using MacPorts will install a "port" version of python.
If you started off with Anaconda python distribution, the easiest way is:
conda install -c anaconda basemap=1.0.7
Please see the page from Anaconda here
The better way is upgrade matplotlib module as follows:
pip3 install matplotlib --upgrade

Resources