Difference between revisions of "ScatterSim:Installing"
(→Installing ScatterSim) |
(→Installing ScatterSim) |
||
Line 1: | Line 1: | ||
== Installing ScatterSim == | == Installing ScatterSim == | ||
− | Here are some rough guidelines into installing ScatterSim | + | Here are some rough guidelines into installing ScatterSim. |
<ol> | <ol> | ||
− | <li> | + | <li> |
Download and install Anaconda <br /> | Download and install Anaconda <br /> | ||
https://www.continuum.io/downloads | https://www.continuum.io/downloads | ||
− | </li> | + | </li> |
− | <li> | + | <li> Download the ScatterSim Library, either: |
+ | |||
+ | <ol> | ||
+ | <li> Direct download | ||
+ | <ol> | ||
+ | <li>Download from https://github.com/CFN-softbio/SciAnalysis/archive/master.zip <br /> | ||
+ | and install to the directory of your choice. | ||
+ | |||
+ | </li> | ||
+ | |||
+ | </ol></li> | ||
+ | |||
+ | <li> | ||
+ | Using git | ||
+ | <ol><li> | ||
Download and install git: <br /> | Download and install git: <br /> | ||
https://git-scm.com/downloads | https://git-scm.com/downloads | ||
− | + | </li> | |
− | </li> | + | <li> |
− | <li> | + | Download the ScatterSim library using git |
− | Download the ScatterSim library using git | + | <ol> |
− | <ol> | + | <li> Open a terminal and choose a directory where you want to install ScatterSim, for example: |
− | <li> Open a terminal and choose a directory where you want to install ScatterSim, for example: | ||
<pre> | <pre> | ||
cd ~/ | cd ~/ | ||
Line 23: | Line 36: | ||
cd software | cd software | ||
</pre> | </pre> | ||
− | </li> | + | </li> |
− | + | ||
− | + | <li>clone:<br/> | |
− | |||
− | <li> | ||
<pre> | <pre> | ||
Line 33: | Line 44: | ||
</pre> | </pre> | ||
(For more information, you may also visit the [http://github.com/CFN-softbio/ScatterSim github page]) | (For more information, you may also visit the [http://github.com/CFN-softbio/ScatterSim github page]) | ||
− | </li> | + | </li> |
− | </li> | + | </ol> |
− | <li> | + | </li> |
+ | </ol></li> | ||
+ | </ol></li> | ||
+ | <li> | ||
Now install ScatterSim | Now install ScatterSim | ||
<pre> | <pre> | ||
Line 42: | Line 56: | ||
</pre> | </pre> | ||
It should now be installed. | It should now be installed. | ||
− | + | ||
− | + | ||
− | </ol> | + | </ol> |
− | + | ||
+ | |||
+ | |||
You should be able to now run ScatterSim in a python environment. | You should be able to now run ScatterSim in a python environment. | ||
− | |||
== Testing ScatterSim == | == Testing ScatterSim == |
Latest revision as of 17:33, 18 July 2017
Installing ScatterSim
Here are some rough guidelines into installing ScatterSim.
-
Download and install Anaconda
https://www.continuum.io/downloads - Download the ScatterSim Library, either:
- Direct download
- Download from https://github.com/CFN-softbio/SciAnalysis/archive/master.zip
and install to the directory of your choice.
- Download from https://github.com/CFN-softbio/SciAnalysis/archive/master.zip
-
Using git
-
Download and install git:
https://git-scm.com/downloads -
Download the ScatterSim library using git
- Open a terminal and choose a directory where you want to install ScatterSim, for example:
cd ~/ mkdir -p software cd software
- clone:
git clone https://github.com/CFN-softbio/ScatterSim.git
(For more information, you may also visit the github page)
- Open a terminal and choose a directory where you want to install ScatterSim, for example:
-
Download and install git:
- Direct download
-
Now install ScatterSim
cd ScatterSim python setup.py develop
It should now be installed.
You should be able to now run ScatterSim in a python environment.
Testing ScatterSim
To test that ScatterSim was properly installed, let's make a folder where we can add code and test.
-
Create a folder where you'll want to store your notebooks, for example, in a terminal, type:
cd ~/software mkdir -p ScatterSim-examples cd ScatterSim-examples
-
In this folder, in the terminal, type:
jupyter notebook
This will open your web browser to run jupyter notebooks.
- Click "New" and select one of the entries under "Notebook". Likely it will say something like "Python 3" or something similar. You should only have one entry (unless you've manually created extra notebook kernels, or installed jupyter on its own).
-
To test that ScatterSim is installed, type in a cell:
from ScatterSim.NanoObjects import SphereNanoObject
and hit SHIFT + ENTER. If you do not receive an error, then it is installed. If you do receive an error, then try to use another kernel (the entries under notebook mentioned in the previous step).
Troubleshooting If this was not successful, then here are some things you may try:
- you have two instances of jupyter installed and you are not running the correct one. Try to find them and uninstall everything. The command (linux/mac)
which jupyter
can help hint where the jupyter version you're using is installed. - Another possibilty is that you are not in the right conda environment. Simply closing your terminal and opening it again could help. Else, you may need to find out the name of your conda environments by typing in a terminal:
conda env list
and finally selecting the correct environment by typing:
source activate ENV
where ENV is one of the names in the list you saw. (it should be one entry unless you've purposely added more environments)
Updating ScatterSim
If you installed using git, you can also update ScatterSim using git. When an update is pushed to the server, it may be retrieved as follows:
-
Go into ScatterSim directory. Ex:
cd ~/software/ScatterSim
-
Then run the following two commands:
git checkout master git pull origin master
NOTE : If you made any changes to ScatterSim, git will complain (this could happen by accidentally opening a file and adding in a whitespace for example). To resolve this, you delete all changes you may have made by typing:
git reset --hard
If you wanted to keep your changes, then one option is to create a new branch for them, such as: may either need to add the changes:
git checkout -b development-branch-name git add <files...> git commit -m "MY Commit message for these edits"
Now your changes are saved and may always be accessed by running:
git checkout development-branch-name
This is likely unnecessary, unless you are digging into the code.