X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0f644e242ef37c911ad3dc25aca8135c339de349..c71a52a28c9cee6511172b3130cf74e8df1b4950:/doc/sdk/python/sdk-python.html.textile.liquid
diff --git a/doc/sdk/python/sdk-python.html.textile.liquid b/doc/sdk/python/sdk-python.html.textile.liquid
index 2b86261ccc..e0dcc5ad2c 100644
--- a/doc/sdk/python/sdk-python.html.textile.liquid
+++ b/doc/sdk/python/sdk-python.html.textile.liquid
@@ -10,66 +10,52 @@ Copyright (C) The Arvados Authors. All rights reserved.
SPDX-License-Identifier: CC-BY-SA-3.0
{% endcomment %}
-The Python SDK provides access from Python to the Arvados API and Keep. It also includes a number of command line tools for using and administering Arvados and Keep, and some conveniences for use in Crunch scripts; see "Crunch utility libraries":crunch-utility-libraries.html for details.
+The Python SDK provides access from Python to the Arvados API and Keep, along with a number of command line tools for using and administering Arvados and Keep.
-h3. Installation
+h2. Installation
If you are logged in to an Arvados VM, the Python SDK should be installed.
-To use the Python SDK elsewhere, you can install from a distribution package, PyPI, or source.
+To use the Python SDK elsewhere, you can install from PyPI or a distribution package.
-{% include 'notebox_begin' %}
-The Python SDK requires Python 2.7.
-{% include 'notebox_end' %}
-
-h4. Option 1: Install from distribution packages
+As of Arvados 2.2, the Python SDK requires Python 3.6+. The last version to support Python 2.7 is Arvados 2.0.4.
-First, "add the appropriate package repository for your distribution":{{ site.baseurl }}/install/install-manual-prerequisites.html#repos.
+h2. Option 1: Install from a distribution package
-{% assign rh_version = "6" %}
-{% include 'note_python_sc' %}
+This installation method is recommended to make the CLI tools available system-wide. It can coexist with the installation method described in option 2, below.
-On Red Hat-based systems:
+First, configure the "Arvados package repositories":../../install/packages.html
-
-~$ sudo yum install python-arvados-python-client
-
-~$ sudo apt-get install python-arvados-python-client
-
+$ apt-get install git build-essential python3-dev libcurl4-openssl-dev libssl-dev +-
~$ git clone https://github.com/curoverse/arvados.git
-~$ cd arvados/sdk/python
-~/arvados/sdk/python$ python2.7 setup.py install
-
-~$python2.7
-Python 2.7.4 (default, Sep 26 2013, 03:20:26) -[GCC 4.7.3] on linux2 +~$python
+Python 3.7.3 (default, Jul 25 2020, 13:03:44) +[GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>import arvados
>>>arvados.api('v1')
@@ -77,56 +63,40 @@ Type "help", "copyright", "credits" or "license" for more information.
current_user = arvados.api('v1').users().current().execute()
-
-my_uuid = current_user['uuid']
-
-some_user = arvados.api('v1').users().get(uuid=my_uuid).execute()
-
-test_link = arvados.api('v1').links().create(
- body={'link_class':'test','name':'test'}).execute()
-
+~$source /usr/share/python3/dist/python3-arvados-python-client/bin/activate
+(python-arvados-python-client) ~$python
+Python 3.7.3 (default, Jul 25 2020, 13:03:44) +[GCC 8.3.0] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>>import arvados
+>>>arvados.api('v1')
+<apiclient.discovery.Resource object at 0x233bb50> +
arvados.api('v1').links().update(
- uuid=test_link['uuid'],
- body={'properties':{'foo':'bar'}}).execute()
-
+~$/usr/share/python3/dist/python3-arvados-python-client/bin/python
+Python 3.7.3 (default, Jul 25 2020, 13:03:44) +[GCC 8.3.0] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>>import arvados
+>>>arvados.api('v1')
+<apiclient.discovery.Resource object at 0x233bb50> +
-repos = arvados.api('v1').repositories().list().execute() -len(repos['items'])
-2 -repos['items'][0]['uuid']
-u'qr1hi-s0uqq-kg8cawglrf74bmw' -