Installation
To install desc
package you must make sure that your python version is either 3.5.x
or 3.6.x
. If you don’t know the version of python you can check it by:
>>>import platform
>>>platform.python_version()
#3.5.3
>>>import tensorflow as tf
>>> tf.__version__
#1.7.0
Note: Because desc depend on tensorflow
, you should make sure the version of tensorflow
is lower than 2.0
if you want to get the same results as the results in our paper.
Now you can install the current release of desc
by the following three ways.
- PyPI
Directly install the package from PyPI.
$ pip install desc
Note: you need to make sure that the pip
is for python3,or we should install desc by
python3 -m pip install desc
#or
pip3 install desc
If you do not have permission (when you get a permission denied error):
$ pip install desc --user
- Github
Download the package from Github and install it locally:
git clone https://github.com/eleozzr/desc
cd desc
pip install .
- Anaconda
If you do not have Python3.5 or Python3.6 installed, consider installing Anaconda (see Installing Anaconda). After installing Anaconda, you can create a new environment, for example, DESC
(you can change to any name you like):
conda create -n DESC python=3.5.3
# activate your environment
source activate DESC
git clone https://github.com/eleozzr/desc
cd desc
python setup.py build
python setup.py install
# now you can check whether `desc` installed successfully!
Please check desc Tutorial for more details.
Run a quick desc test
Now, let us run a quick test to see if the desc is ready.
Firstly, enter Python’s interpreter from your console:
$ python
Then, in a Python interpeter session, type
>>> import desc
>>> desc.run_desc_test()
The run_desc_test()
function enables you to perform a quick desc analysis on a small pre-processed data. If you see something like:
“The desc has been trained successfully!”
…
“The run time is xxx.xxxx”.
Then you are ready to go.
Troubleshooting
- For Linux users:
If you see
*/ld: cannot find -l***
, it means that it cannot find lib file, wherel***
stands for the link lib filelib***.so
. The first thing you need is to install the corresponding lib file. For example, if you see*/ld: cannot find -lxml2
, you can try#For ubuntu/debian users you can try sudo apt-get install python3-dev sudo apt-get install libxml2-dev #For ubuntu/debian users you can try sudo yum install libxml2-devel sudo yum install libxml2-devel
Then, try to install desc again. If the issue still arises, you should try the following (with the permission), take libxml2 as an example:
cd /usr/lib64 ls -al|grep "xml2" sudo ln -s libxml2.so.2 libxml2.so ls -al|grep "xml2"
-
For Windows users: Check python-igraph if there are some issues when installing
python-igraph
(desc
depends onpython-igraph
). Note that the automatic compilation of the C core when runningpip install python-igraph
will not work on Windows! So the preferred way to install the Python interface on Windows is to download one of the unofficial installers built by Christoph Gohlke. Download it according to your python and Windows version. Becausepython-igraph
depends onpycairo
, you should download pycairo firstly. - Take python3.6 on win64 as an example. After downloading
pycairo
andpython-igraph
, you can run following commands.pip install pycairo-1.18.0-cp36-cp36m-win_amd64.whl pip install python_igraph-0.7.1.post6-cp36-cp36m-win_amd64.whl
- If you have some installation issues about
pydot
,- For Linux users, you should run
pip3 install pydot graphviz
. - For Windows users, you should download Graphviz from Graphviz and you need to set the PATH variable yourself. After that, you should close the
cmd
window and restart anothercmd
window.#here I downloaded 'graphviz' in C:\Users\dell\Desktop >>>import os >>>graphviz_setup="C:\Users\dell\Desktop\graphviz-2.38\release\bin" >>>os.environ["PATH"] += os.pathsep + graphviz_setup
- For Linux users, you should run