-
Notifications
You must be signed in to change notification settings - Fork 58
1. Installation
JSNAPy requires Python 2.7 or Python>=3.4 and associated pip tool
1. Install from PyPI
sudo pip install jsnapy
2. Install using pip command from source code
sudo pip install git+https://github.com/Juniper/jsnapy.git
3. Install by cloning source code
a) Clone the source code from this git repository
git clone https://github.com/Juniper/jsnapy
Or Download source code from
https://github.com/Juniper/jsnapy
Untar jsnapy-master.zip (if downloaded zip folder) using command
unzip jsnapy-master.zip
b) Go to jsnapy-master folder and install by:
sudo pip install .
or
sudo python setup.py sdist
sudo pip install dist/jsnapy-x.x.tar.gz
-
Update using pip command from source code
sudo pip install -U git+https://github.com/Juniper/jsnapy.git
-
Update using pip command from PyPI
sudo pip install -U jsnapy
-
Jsnapy has the following default structure during installation:
/etc/jsnapy/ |____ testfiles/ |____ snapshots/ |____ jsnapy.cfg |____ logging.yml
-
/etc/jsnapy
also serves as the default lookup directory to search for configuration files when running various jsnapy commands. -
To change the default lookup directory during installation one can use the following commands:
- Installation via pip:
sudo pip install jsnapy --install-option="--install-data=~/Desktop/test_inst"
or
sudo pip install dist/jsnapy-x.x.tar.gz --install-option="--install-data=~/Desktop/test_inst"
- Installation via setup.py:
sudo python setup.py install --install-data ~/Desktop/test_inst
- Installation via pip:
Use the above installation methods, without sudo. This would avoid system wide installation and help using JSNAPy installed within the virtual environment.
Following these steps should do the installation:
virtualenv venv
source venv/bin/activate
pip install jsnapy
Now to check which jsnapy is being used, try
which jsnapy
This should point to venv/bin/jsnapy
In Some Cases it has been observed that on uninstalling jsnapy from a virtualenv(venv) and then reinstalling jsnapy in the same environment, prevents the creation of the venv/var and venv/etc folders. the reason is that the pip during install picks up the cache and tries to install it. This prevents the creation of the env/var and env/etc folders.
Recommended way of installing in virtualenv is from source using-
Suggested:
pip install --no-cache jsnapy
Also works with:
pip install --no-binary jsnapy jsnapy
The above installation are also applicable in windows. The above command will install jsnapy. It can also be installed with custom directories or from github source code as per given arguments.
Note:
- sudo is not identified in windows
- /etc/jsnapy is identified in unix based devices, for windows the entire structure is with respect to ~/jsnapy/ and for python virtual environment let's say venv, it is venv/etc/jsnapy/
'~' : user home directory