官术网_书友最值得收藏!

Creating your first Python virtual environment

Now that we have installed the Python toolset, let's take it for a test drive by creating a Python project that can interact with the AWS cloud platform. First, let's create a directory for the project and name it ObjectDetectionDemo. Within this directory, we initialize a Python 3 virtual environment with pipenv, as follows:

$ mkdir ObjectDetectionDemo
$ cd ObjectDetectionDemo
$ pipenv --three

After these commands, the ObjectDetectionDemo directory will contain a Pipfile. The Pipfile is a pipenv configuration file that specifies this project's Python packages and their dependencies.

Next, we specify and install the AWS Python SDK, Boto, for the ObjectDetectionDemo project:

$ pipenv install boto3

It might take a few minutes for Pipenv to synchronize with the Python package index and to install the boto3 package, along with its dependencies. After the installation, your Pipefile should have the following contents:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
"boto3" = "*"

[requires]
python_version = "3.7"

As you can see here, boto3 has an entry under the packages section. Currently, the version number is listed as *, which means, use the latest version. You can replace * with a specific version for any of the packages for your project if necessary.

主站蜘蛛池模板: 宣恩县| 阿拉善右旗| 亳州市| 兴化市| 赫章县| 贡觉县| 西安市| 河津市| 徐闻县| 略阳县| 敦化市| 新兴县| 顺平县| 辛集市| 商都县| 沿河| 奈曼旗| 合山市| 自贡市| 开封县| 虎林市| 榆林市| 青川县| 娱乐| 筠连县| 嵊州市| 穆棱市| 巴东县| 措勤县| 乌兰察布市| 离岛区| 吴旗县| 隆子县| 安顺市| 张家川| 连江县| 翁牛特旗| 什邡市| 石狮市| 女性| 安图县|