Installation¶
If you don’t need source, the simplest way to install the TDDA library is
to do a normal pip
install:
pip install tdda
If you have multiple Python installations and want to ensure you use the right one, use:
python -m pip install tdda
replacing python
with whatever you need to use to run your target
version of Python.
If you want it installed for all users and don’t have write access to
your Python’s site packages, you should change the permissions
so that you can write it, or log in as a user who does have permission,
or add sudo
before the pip
or python
command.
Upgrading¶
Add --upgrade
or -U
after install
in the commands above
to upgrade an existing installation.
This is a general pattern for pip
:
pip install -U tdda
or:
python -m pip install -U tdda
Source installation¶
The tdda project is hosted on Github at github.com/tdda/tdda.
If you want to do a source installation, that’s probably all you need to know, but:
git clone git@github.com:tdda/tdda.git
or:
git clone https://github.com/tdda/tdda.git
is the command to get it.
Then:
python setup.py install
should install it.
Checking the installation¶
If all has gone well, you should be able to type:
tdda
and it will show you some help.
You should also be able to use:
>>> import tdda
>>> tdda.__version__
from your Python successfully.
Finally, you should be able to run the tests with no failures, like this for example:
cd tdda/tdda
python testtdda.py
Skipping Postgres tests (no driver library)
Skipping MySQL tests (no driver library)
......................................................................................................ssssssssss..................................................................sssss..............................
----------------------------------------------------------------------
Ran 213 tests in 18.421s
OK (skipped=15)
Some tests will be skipped (s
) if you don’t have various libraries
or haven’t (yet) told TDDA about any databases you might want to use.
Optional Installations for using Databases, Feather Files, Pandas¶
Extra libraries are required to access some of the constraint-generation and verification functionality, depending on the data sources that you wish to use.
pandas
(required for CSV files andfeather
files)feather-format
(required forfeather
files)pmmif
(makesfeather
file reading and writing more robust)pygresql
(required for PostgreSQL database tables)MySQL-python
ormysqlclient
ormysql-connector-python
(required for MySQL database tables)pymongo
(required for MongoDB document collections)
These can be installed with (some/all of):
pip install pandas
pip install feather-format
pip install pmmif
pip install pygresql
pip install pymongo
and, for MySQL, one of:
pip install MySQL-python
pip install mysqlclient
pip install mysql-connector-python
To install feather-format
on Windows, you will need to install
cython
as a prerequisite, which might also require you to install
the Microsoft Visual C++ compiler for Python.