Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
standardize virtualenv for python instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemart committed Jan 3, 2019
1 parent 705178c commit 4af5b7d
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Follow these steps to setup and run this code pattern. The steps are
described in detail below.

1. [Clone the repo](#1-clone-the-repo)
2. [Install Prerequisites](#2-install-prerequisites)
2. [Install dependencies](#2-install-dependencies)
3. [Generate Image Data](#3-generate-image-data)
4. [Convert Images to TFRecords](#4-convert-images-to-tfrecords)
5. [Train the Model](#5-train-the-model)
Expand All @@ -82,30 +82,34 @@ Clone the `tensorflow-hangul-recognition` locally. In a terminal, run:
git clone https://github.com/IBM/tensorflow-hangul-recognition
```

### 2. Install Prerequisites
### 2. Install dependencies

Go to your cloned repo directory:
```
cd tensorflow-hangul-recognition
The general recommendation for Python development is to use a virtual environment [(venv)](https://docs.python.org/3/tutorial/venv.html). To install and initialize a virtual environment, use the `venv` module on Python 3 (you install the virtualenv library for Python 2.7):

```bash
# Create the virtual environment using Python. Use one of the two commands depending on your Python version.
# Note, it may be named python3 on your system.

$ python -m venv mytestenv # Python 3.X
$ virtualenv mytestenv # Python 2.X

# Now source the virtual environment. Use one of the two commands depending on your OS.

$ source mytestenv/bin/activate # Mac or Linux
$ ./mytestenv/Scripts/activate # Windows PowerShell
```

Optionally, to isolate your runtime environment, use a virtual environment as described
[here](https://packaging.python.org/guides/installing-using-pip-and-virtualenv/).
Create a virtual environment:
Now go to the cloned repo directory:
```
python -m pip install --user virtualenv
python -m virtualenv .venv
cd tensorflow-hangul-recognition
```

Then activate the virtual environment with `source .venv/bin/activate` on Linux/macOS or
`.venv\Scripts\activate` on Windows.

Install the python requirements for this code pattern. Run:
Install the Python requirements for this code pattern. Run:
```
pip install -r requirements.txt
```

When you have completed the code pattern, use the `deactivate` command to leave the virtual environment.
> **TIP** :bulb: To terminate the virtual environment use the `deactivate` command.
**Note:** For Windows users, the _scipy_ package is not installable via **pip**.
The recommended way to use _scipy_ is to install a
Expand Down Expand Up @@ -434,4 +438,4 @@ writing.

This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the [Developer Certificate of Origin, Version 1.1 (DCO)](https://developercertificate.org/) and the [Apache Software License, Version 2](http://www.apache.org/licenses/LICENSE-2.0.txt).

[Apache Software License (ASL) FAQ](http://www.apache.org/foundation/license-faq.html#WhatDoesItMEAN)
[Apache Software License (ASL) FAQ](http://www.apache.org/foundation/license-faq.html#WhatDoesItMEAN)

0 comments on commit 4af5b7d

Please sign in to comment.