简体   繁体   English

使用 setup.py 安装本地 package

[英]Install local package using setup.py

Using swagger.io's editor I have generater a API client from a provided swagger file.使用 swagger.io 的编辑器,我从提供的 swagger 文件生成了一个 API 客户端。 In pycharm I have then created a new project with own virtual environment adn wishes to install the generated client and work from there.在 pycharm 中,我创建了一个具有自己的虚拟环境的新项目,并希望安装生成的客户端并从那里工作。 So that I have a "main" file ala (only illustrative):所以我有一个“主”文件ala(仅说明性):

import swagger_client
from datetime import datetime, timedelta, date
import pandas as pd
data = swagger_client.get()
df = pd.DataFrame(data)
... 
results = df

Right now i just placed the python-clinet folder in my main folder for the project:现在我刚刚将 python-clinet 文件夹放在项目的主文件夹中:

C:\Users\(username)\PycharmProjects\API\

This python-client folder contains a the client generated from the swaggerfile and includes the requriment.txt and setup.py files along with a swagger-client folder which contains the actual client I need to install (I assume).这个 python-client 文件夹包含一个从 swaggerfile 生成的客户端,包括 requriment.txt 和 setup.py 文件以及一个 swagger-client 文件夹,其中包含我需要安装的实际客户端(我假设)。

I have mostly just worked within a actual script in pycharm and know that i need to work on my skillset above just the py file im working in.我大部分时间只是在 pycharm 的实际脚本中工作,并且知道我需要在我正在使用的 py 文件之上处理我的技能集。

So how do I from here install the python client the easiest way.那么我如何从这里以最简单的方式安装 python 客户端。 Online searches give a lot of answers I find unfit, but that may be because of my limited skillset.在线搜索给出了很多我认为不合适的答案,但这可能是因为我的技能有限。 So please dump it a bit down.所以请把它扔掉一点。

BR BR

Okay to quick asking for help.好的,可以快速寻求帮助。

In the pycharm terminal (not console) I wrote:在 pycharm 终端(不是控制台)中,我写道:

python -m pip install -e C:\Users\(user_name)\PycharmProjects\API\python-client

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM