侧边栏壁纸
博主头像
nivnek博主等级

道阻且长,行则将至

  • 累计撰写 21 篇文章
  • 累计创建 27 个标签
  • 累计收到 1 条评论

目 录CONTENT

文章目录

Start openai api example with python

kenvin
2023-02-14 / 0 评论 / 0 点赞 / 825 阅读 / 2234 字

version

  • python 3.7+
  • openssl 1.1.1+

Download a spcific release

wget https://www.python.org/ftp/python/3.10.10/Python-3.10.10.tgz

Download openssl

wget https://www.openssl.org/source/openssl-1.1.1t.tar.gz

Install

  1. openssl
./configure  --prefix=/usr/local/openssl
make; make install
  1. python
./configure  --prefix=/usr/local/py3.10 --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions --with-openssl=/usr/local/openssl --with-openssl-rpath=auto
make -j4;make altinstall

Download openai-quickstart-python

git  clone https://github.com/openai/openai-quickstart-python.git
cd openai-quickstart-python
python -m venv ai
. ai/bin/activate
pip install -r requirements.txt
cp .env.example .env
flask run -p 18000 -h 0.0.0.0

Solve Python error: subprocess-exited-with-error

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for X
ERROR: Could not build wheels for X, which is required to install pyproject.toml-based projects
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.

pip3 install wheel setuptools pip --upgrade	
0

评论区