Setting Up Python Environment and Project Configuration

1.Download link for Python

https://www.python.org/downloads/windows/

Setting Up Python Environment and Project Configuration

2. Installation

Select custom installation, and make sure to check the box to add Python to the environment path;

Verification after installation:

python --version
pip --version

Pip is the package manager for Python

3. Create a virtual environment

First, create a project directory, for example, E:\Code\llmops\llmops-api

Open cmd in that directory and execute the command

 python -m venv env

Setting Up Python Environment and Project Configuration

This will generate the directory structure files

Setting Up Python Environment and Project Configuration

Activate env:env\Scripts\activate

Setting Up Python Environment and Project ConfigurationSetting Up Python Environment and Project Configuration

You are now in the env environment, and all installed packages will be in the virtual environment

For example, to install OpenAI

pip install openai

Setting Up Python Environment and Project Configuration

After installation is complete, you will find the OpenAI package in the E:\Code\llmops\llmops-api\env\Lib\site-packages directory

Setting Up Python Environment and Project Configuration

Exit the virtual environment: env\Scripts\deactivate

Setting Up Python Environment and Project Configuration

4. Tencent Cloud pip mirror acceleration configuration

The domestic site has a complete copy of all pip packages. Using the domestic mirror site will speed up downloads.

Global usage:

pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple

Example of using Tencent Cloud pip mirror acceleration (installing langchain)

(env) E:\Code\llmops\llmops-api>pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simpleWriting to C:\Users\Administrator\AppData\Roaming\pip\pip.ini
(env) E:\Code\llmops\llmops-api>pip config listglobal.index-url='https://mirrors.cloud.tencent.com/pypi/simple'
(env) E:\Code\llmops\llmops-api>pip install langchainLooking in indexes: https://mirrors.cloud.tencent.com/pypi/simpleCollecting langchain  Downloading https://mirrors.cloud.tencent.com/pypi/packages/c1/e9/d9e23971c9d9286f78b58c298ab6a2bc10181040cb3c84aacb5091f0201d/langchain-1.0.8-py3-none-any.whl (93 kB)Collecting langchain-core<2.0.0,>=1.0.6 (from langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/71/1e/e129fc471a2d2a7b3804480a937b5ab9319cab9f4142624fcb115f925501/langchain_core-1.1.0-py3-none-any.whl (473 kB)Collecting langgraph<1.1.0,>=1.0.2 (from langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/84/a3/fdf6ecd0e44cb02d20afe7d0fb64c748a749f4b2e011bf9a785a32642367/langgraph-1.0.3-py3-none-any.whl (156 kB)Requirement already satisfied: pydantic<3.0.0,>=2.7.4 in e:\code\llmops\llmops-api\env\lib\site-packages (from langchain) (2.12.4)Collecting jsonpatch<2.0.0,>=1.33.0 (from langchain-core<2.0.0,>=1.0.6->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/73/07/02e16ed01e04a374e644b575638ec7987ae846d25ad97bcc9945a3ee4b0e/jsonpatch-1.33-py2.py3-none-any.whl (12 kB)Collecting langsmith<1.0.0,>=0.3.45 (from langchain-core<2.0.0,>=1.0.6->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/d6/cb/02610a918e7630687d7fae0f668035b92def7ba0e1a7956bdf1f7098a32c/langsmith-0.4.46-py3-none-any.whl (411 kB)Collecting packaging<26.0.0,>=23.2.0 (from langchain-core<2.0.0,>=1.0.6->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl (66 kB)Collecting pyyaml<7.0.0,>=5.3.0 (from langchain-core<2.0.0,>=1.0.6->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl (154 kB)Collecting tenacity!=8.4.0,>=8.1.0 (from langchain-core<2.0.0,>=1.0.6->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/e5/30/643397144bfbfec6f6ef821f36f33e57d35946c44a2352d3c9f0ae847619/tenacity-9.1.2-py3-none-any.whl (28 kB)Requirement already satisfied: typing-extensions<5.0.0,>=4.7.0 in e:\code\llmops\llmops-api\env\lib\site-packages (from langchain-core<2.0.0,>=1.0.6->langchain) (4.15.0)Collecting jsonpointer>=1.9 (from jsonpatch<2.0.0,>=1.33.0->langchain-core<2.0.0,>=1.0.6->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/71/92/5e77f98553e9e75130c78900d000368476aed74276eb8ae8796f65f00918/jsonpointer-3.0.0-py2.py3-none-any.whl (7.6 kB)Collecting langgraph-checkpoint<4.0.0,>=2.1.0 (from langgraph<1.1.0,>=1.0.2->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/48/e3/616e3a7ff737d98c1bbb5700dd62278914e2a9ded09a79a1fa93cf24ce12/langgraph_checkpoint-3.0.1-py3-none-any.whl (46 kB)Collecting langgraph-prebuilt<1.1.0,>=1.0.2 (from langgraph<1.1.0,>=1.0.2->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/87/5e/aeba4a5b39fe6e874e0dd003a82da71c7153e671312671a8dacc5cb7c1af/langgraph_prebuilt-1.0.5-py3-none-any.whl (35 kB)Collecting langgraph-sdk<0.3.0,>=0.2.2 (from langgraph<1.1.0,>=1.0.2->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/66/05/b2d34e16638241e6f27a6946d28160d4b8b641383787646d41a3727e0896/langgraph_sdk-0.2.9-py3-none-any.whl (56 kB)Collecting xxhash>=3.5.0 (from langgraph<1.1.0,>=1.0.2->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/86/15/9bc32671e9a38b413a76d24722a2bf8784a132c043063a8f5152d390b0f9/xxhash-3.6.0-cp313-cp313-win_amd64.whl (31 kB)Collecting ormsgpack>=1.12.0 (from langgraph-checkpoint<4.0.0,>=2.1.0->langgraph<1.1.0,>=1.0.2->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/ce/15/429c72d64323503fd42cc4ca8398930ded8aa8b3470df8a86b3bbae7a35c/ormsgpack-1.12.0-cp313-cp313-win_amd64.whl (112 kB)Requirement already satisfied: httpx>=0.25.2 in e:\code\llmops\llmops-api\env\lib\site-packages (from langgraph-sdk<0.3.0,>=0.2.2->langgraph<1.1.0,>=1.0.2->langchain) (0.28.1)Collecting orjson>=3.10.1 (from langgraph-sdk<0.3.0,>=0.2.2->langgraph<1.1.0,>=1.0.2->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/c0/a9/967be009ddf0a1fffd7a67de9c36656b28c763659ef91352acc02cbe364c/orjson-3.11.4-cp313-cp313-win_amd64.whl (131 kB)Collecting requests-toolbelt>=1.0.0 (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.6->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/3f/51/d4db610ef29373b879047326cbf6fa98b6c1969d6f6dc423279de2b1be2c/requests_toolbelt-1.0.0-py2.py3-none-any.whl (54 kB)Collecting requests>=2.0.0 (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.6->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/1e/db/4254e3eabe8020b458f1a747140d32277ec7a271daf1d235b70dc0b4e6e3/requests-2.32.5-py3-none-any.whl (64 kB)Collecting zstandard>=0.23.0 (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.6->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/d9/82/b9c06c870f3bd8767c201f1edbdf9e8dc34be5b0fbc5682c4f80fe948475/zstandard-0.25.0-cp313-cp313-win_amd64.whl (506 kB)Requirement already satisfied: anyio in e:\code\llmops\llmops-api\env\lib\site-packages (from httpx>=0.25.2->langgraph-sdk<0.3.0,>=0.2.2->langgraph<1.1.0,>=1.0.2->langchain) (4.11.0)Requirement already satisfied: certifi in e:\code\llmops\llmops-api\env\lib\site-packages (from httpx>=0.25.2->langgraph-sdk<0.3.0,>=0.2.2->langgraph<1.1.0,>=1.0.2->langchain) (2025.11.12)Requirement already satisfied: httpcore==1.* in e:\code\llmops\llmops-api\env\lib\site-packages (from httpx>=0.25.2->langgraph-sdk<0.3.0,>=0.2.2->langgraph<1.1.0,>=1.0.2->langchain) (1.0.9)Requirement already satisfied: idna in e:\code\llmops\llmops-api\env\lib\site-packages (from httpx>=0.25.2->langgraph-sdk<0.3.0,>=0.2.2->langgraph<1.1.0,>=1.0.2->langchain) (3.11)Requirement already satisfied: h11>=0.16 in e:\code\llmops\llmops-api\env\lib\site-packages (from httpcore==1.*->httpx>=0.25.2->langgraph-sdk<0.3.0,>=0.2.2->langgraph<1.1.0,>=1.0.2->langchain) (0.16.0)Requirement already satisfied: annotated-types>=0.6.0 in e:\code\llmops\llmops-api\env\lib\site-packages (from pydantic<3.0.0,>=2.7.4->langchain) (0.7.0)Requirement already satisfied: pydantic-core==2.41.5 in e:\code\llmops\llmops-api\env\lib\site-packages (from pydantic<3.0.0,>=2.7.4->langchain) (2.41.5)Requirement already satisfied: typing-inspection>=0.4.2 in e:\code\llmops\llmops-api\env\lib\site-packages (from pydantic<3.0.0,>=2.7.4->langchain) (0.4.2)Collecting charset_normalizer<4,>=2 (from requests>=2.0.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.6->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/c4/26/b9924fa27db384bdcd97ab83b4f0a8058d96ad9626ead570674d5e737d90/charset_normalizer-3.4.4-cp313-cp313-win_amd64.whl (107 kB)Collecting urllib3<3,>=1.21.1 (from requests>=2.0.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.6->langchain)  Downloading https://mirrors.cloud.tencent.com/pypi/packages/a7/c2/fe1e52489ae3122415c51f387e221dd0773709bad6c6cdaa599e8a2c5185/urllib3-2.5.0-py3-none-any.whl (129 kB)Requirement already satisfied: sniffio>=1.1 in e:\code\llmops\llmops-api\env\lib\site-packages (from anyio->httpx>=0.25.2->langgraph-sdk<0.3.0,>=0.2.2->langgraph<1.1.0,>=1.0.2->langchain) (1.3.1)Installing collected packages: zstandard, xxhash, urllib3, tenacity, pyyaml, packaging, ormsgpack, orjson, jsonpointer, charset_normalizer, requests, jsonpatch, requests-toolbelt, langgraph-sdk, langsmith, langchain-core, langgraph-checkpoint, langgraph-prebuilt, langgraph, langchainSuccessfully installed charset_normalizer-3.4.4 jsonpatch-1.33 jsonpointer-3.0.0 langchain-1.0.8 langchain-core-1.1.0 langgraph-1.0.3 langgraph-checkpoint-3.0.1 langgraph-prebuilt-1.0.5 langgraph-sdk-0.2.9 langsmith-0.4.46 orjson-3.11.4 ormsgpack-1.12.0 packaging-25.0 pyyaml-6.0.3 requests-2.32.5 requests-toolbelt-1.0.0 tenacity-9.1.2 urllib3-2.5.0 xxhash-3.6.0 zstandard-0.25.0
[notice] A new release of pip is available: 25.2 -> 25.3[notice] To update, run: python.exe -m pip install --upgrade pip
(env) E:\Code\llmops\llmops-api>env\Scripts\deactivateE:\Code\llmops\llmops-api>

Leave a Comment