Install Anaconda (miniconda) and Jupyter on Cloud9. It's been a few years since I've been developing a program, and I'm surprised that I can now develop a program in the cloud. Anyway, I have almost no knowledge of cloud9, jupyter, and anaconda, and I struggled to install and operate the package from scratch.
--Cloud9 paid version --miniconda (minimum configuration of anaconda) Reference: Site that describes anaconda and conda
I thought Cloud9 was free, but every time I installed the tool, I ran out of space and 2G quickly reached 100%. Therefore, I had to use the paid version. It's $ 19 a month. It is safer to set the disk capacity to 15G.
Just enter the command below and enter your password! Thank you very much. http://qiita.com/y__sama/items/58419e85f39265fe6df8
git clone https://github.com/y-sama/cloud9.git
bash cloud9/init.sh (Basic "y" is fine when installation confirmation is given)
Mainly, it seems that Jupyter and python will be available. A jupyter password will be created during installation, so enter it appropriately.
Now restart the shell.
After the installation is complete, run jupyter notebook from the command line to start jupyter. ~~ After the installation is completed, run jupyter under cloud9 from jupyter and run jupyter. ~~ After that, when you access from the browser with /xxxx.username.c9users.io/tree# xxxx: workspace name, you will be asked to enter the password, so when you enter the password, the jupyter screen will be displayed.
When I execute the following code with jupyter, an error occurs. The language of the project should be python3.
import numpy as np
Error details
ImportError Traceback (most recent call last)
Action
The error is that the numpy module is missing. I searched variously and executed the following two commands to fix it.
Reference site http://qiita.com/y__sama/items/58419e85f39265fe6df8
――If you have miniconda instead of Anaconda, it's probably OK if you add this much.
conda install jupyter scikit-learn bokeh seaborn pandas dask networkx numba pep8 pillow scikit-image sqlalchemy sqlite statsmodels sympy xlrd xlsxwriter xlwt
――You should set this much around Anaconda.
echo 'alias activate="source $PYENV_ROOT/versions/anaconda3-4.0.0/bin/activate"' >> ~/.bashrcsource ~/.bashrc
conda install seaborn # anaconda is not included, so put it in `` `
Now restart the shell again.
### Unable to read modules in chapter directory
jupyter seems to be executed in the directory under jupyter. For example, in the case of Chapter 4, the module used in deep learning is under ch04, so it is necessary to pre-populate the path.
<br> Error details <br>
ImportError Traceback (most recent call last)
<br> Action <br>
import sys sys.path.append('/home/ubuntu/workspace/jupyter/ch04')###Enter the chapter directory path like this import numpy as np import matplotlib.pylab as plt from gradient_2d import numerical_gradient #If you do not enter the path, you will get an error if the module is not found here
### From dataset.mnist import load_mnist causes a module load error.
--If you do not expand the book file (https://github.com/oreilly-japan/deep-learning-from-scratch) under jupyter, an error will occur when you import the module when you run the program on jupyter.
Expand it under the jupyter folder as shown in the figure below.
![jupyter1.png](https://qiita-image-store.s3.amazonaws.com/0/188563/6d767cc6-6455-571d-ec15-ef755e6417be.png)
### Graph display on jupyter
If jupyter works properly, the graph will be displayed as shown below.
![jupyter2.png](https://qiita-image-store.s3.amazonaws.com/0/188563/35777aa1-6d3a-c43f-7d3f-25f40c2bc670.png)
Recommended Posts