File: quickstart.rst

package info (click to toggle)
transip 2.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 256 kB
  • sloc: python: 1,280; makefile: 18; sh: 4
file content (68 lines) | stat: -rw-r--r-- 1,842 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Quickstart
==========

.. currentmodule:: transip-api

You can get the library directly from PyPI::

    pip install transip-api

The installation into a :ref:`virtualenv` is heavily recommended.

.. _virtualenv:

virtualenv
----------

Virtualenv is probably what you want to use for developing Python
applications.

If you are on Mac OS X or Linux, chances are the one of the following two
commands will work for you::

   $ sudo easy_install virtualenv

or even better::

   $ sudo pip install virtualenv

One of these will probably install virtualenv on your system. Maybe it's even
in your package manager. If you use Ubuntu, try::

   $ sudo apt-get install python-virtualenv

If you are on Windows (or none of the above methods worked) you must install
``pip`` first. For more information about this, see `installing pip`_.
Once you have it installed, run the ``pip`` command from above, but without
the ``sudo`` prefix.

.. _installing pip: https://pip.readthedocs.io/en/latest/installing.html

Once you have virtualenv installed, just fire up a shell and create your own
environment. You could create a project folder and a `venv` folder within::

   $ mkdir myproject
   $ cd myproject
   $ virtualenv venv

Now, whenever you want to work on a project, you only have to activate the
corresponding environment. On Mac OS X and Linux, do the following::

   $ . venv/bin/activate

If you are on Windows, use the following command::

   $ venv\scripts\activate

Either way, you should now be using your virtualenv (notice how the promt of
you shell has changed to show the active environment).

And if you want to exit your virtualenv, use the following command::

   $ deactivate

Enter the following command to get transip-api installed in your virtualenv::

   $ pip install virtualenv

A few seconds later and your are good to go.