Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove most of installing instructions in favor of Github #151

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 16 additions & 79 deletions pages/intro/install.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,36 @@ \subsection{Desktops vs. Laptops}

If you have decided to use one of our provided desktops, all installation procedures have been carried out. You merely need to go to the \verb+lxmls-toolkit-student+ folder inside your home directory and start working! You may go directly to section \ref{sec:SolvingExercises}. If you wish to use your own laptop, you will need to install Python, the required Python libraries and download the LXMLS code base. It is important that you do this as soon as possible (before the school starts) to avoid unnecessary delays. Please follow the install instructions.

\subsection{Downloading the labs version from GitHub student branch}
\subsection{Basic Install and Troubleshooting}

The code of LxMLS is available online at GitHub. There are two branches of the code: the \verb+master+ branch contains fully functional code. \textbf{important}: The \verb+student+ branch contains the same code with some parts deleted, which you must complete in the following exercises. Download the \verb+student+ code by going to
To install, just follow the instructions in our Github repository for the \verb+student+ version of our toolkit

\begin{verbatim}
https://github.com/LxMLS/lxmls-toolkit
\end{verbatim}

\noindent and select the \verb+student+ branch in the dropdown menu. This will reload the page to the corresponding branch. Now you just need to click the \verb+clone or download + button to obtain the lab tools in a zip format:

\begin{verbatim}
lxmls-toolkit-student.zip
\end{verbatim}

After this you can unzip the file where you want to work and enter the unzipped folder. This will be the place where you will work.

\subsection{Installing Python from Scratch with Anaconda}

If you are new to Python the best option right now is the Anaconda platform. You can find installers for Windows, Linux and OSX platforms here

\begin{verbatim}
https://www.anaconda.com/download/
https://anaconda.org/pytorch/pytorch
\end{verbatim}

Finally install the LXMLS toolkit symbolically. This will allow you to modify the code and see the changes take place immediately.

\begin{verbatim}
python setup.py develop
\end{verbatim}

\noindent The guide supports both Python2 and Python3. We strongly recommend that you use Python3 as Python2 is being deprecated.

\begin{verbatim}
\end{verbatim}

\subsection{Installing with Pip}

If you are familiar with Python you will probably be used to the pip package installer. In this case it might be more easy for you to install the packages yourself using pip and a virtual environment. This will avoid conflicting with existing python installations. To install and create a virtual environment do

\begin{verbatim}
cd lxmls-toolkit-student
sudo pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install --editable .
\end{verbatim}

If you also need to install a new python version, e.g. your systems Python is still Python2 and you can not change this, you can virtualize different Python versions as well. Have a look at pyenv. This will hijack your python binary and allow you
switch between Python 2, 3 or install concrete versions for a particular folder. To install pyenv
\begin{itemize}
\item \url{https://github.com/LxMLS/lxmls-toolkit/tree/student#readme}.
\end{itemize}

\begin{verbatim}
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
\end{verbatim}
The \verb+student+ branch contains the same code as \verb+master+ branch, with some parts deleted, which you must complete in the following exercises.

\noindent and add the following to your .bashrc or .bash\_profile
The basic install instructions use miniconda. If this is not your tool of choice, you can install it with \texttt{pip} as an alternative. In order to do this, you first need to run

\begin{verbatim}
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)
\end{verbatim}
\texttt{python3 -m venv lxmls\_venv}

be careful if you already redefine Python's path in these files. If you do not feel comfortable with this its better to ask for help. Once installed you can do the following in the LxMLS folder
where \texttt{lxmls\_venv} is the name (and path) to your virtual environment. Then, you activate the environment with

\begin{verbatim}
source ~/.bashrc
pyenv install 3.6.0
pyenv local 3.6.0
\end{verbatim}
\texttt{source lxmls\_venv/bin/activate}

\noindent to install and set the version of python for that folder to Python 3.6.0
and afterwards you install jupyter with pip:

\texttt{pip install jupyter}

\subsection{(Advanced Users) Forking and cloning the code on GitHub}
Note that, after activating the environment with the command \texttt{source}, the name of the environment should be shown between parentheses in the command line. Make sure this is the case before installing jupyter. After this, you can double check the installation worked by running the following command:

It might be the case that you feel very comfortable with scientific Python, know some git/GitHub and want to extend/improve our code base. In that case you can directly clone the project with
\texttt{pip install ipykernel}

\begin{verbatim}
git clone https://github.com/LxMLS/lxmls-toolkit.git
cd lxmls-toolkit/
git checkout student
pip install --editable .
\end{verbatim}
if this installation also worked, then you just need to run the following command so your new virtual environment is also shown in the jupyter notebooks as an interpreter of your choice.

\textbf{Note:}
\noindent If you are experiencing issues on Windows, you would probably have to install pytorch first.
\begin{verbatim}
pip install https://download.pytorch.org/whl/cpu/torch-1.1.0-cp36-cp36m-win_amd64.whl
pip install https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp36-cp36m-win_amd64.whl
\end{verbatim}
\texttt{python -m ipykernel install -{}-user -{}-name lxmls\_venv -{}-display-name ``LxMLS venv"}

\noindent If you want to contribute to the code-base, you can make pull requests to the \textit{develop} branch or raise issues.

\subsection{Deciding on the IDE and interactive shell to use}

Expand Down