编程语言
首页 > 编程语言> > python38安装jsonpath失败问题解决

python38安装jsonpath失败问题解决

作者:互联网

前言

在linux 上安装了python3.8.5环境,pip安装jsonpath的时候一直无法安装成功

遇到问题

运行环境:linux
python环境:3.8.5
pip安装jsonpath

# pip3 install jsonpath
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Requirement already satisfied: jsonpath in /root/python3/lib/python3.6/site-packages (0.82)
You are using pip version 18.1, however version 21.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@iZ2vchn8sk983jm605yhshZ hrun2_web]# pip38 install jsonpath
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Collecting jsonpath
  Using cached http://mirrors.cloud.aliyuncs.com/pypi/packages/5f/c0/b54189dfe62f1a93ba294ab53508a81d440fc63adff253db369f557a996a/jsonpath-0.82.tar.gz (9.6 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

一直无法安装成功

解决办法

可以先下载安装包到本地,在本地解压安装

wget http://www.ultimate.com/phil/python/download/jsonpath-0.82.tar.gz

解压文件

tar -xvf jsonpath-0.82.tar.gz 

用setup.py安装

# cd jsonpath-0.82
# python38 setup.py install

show查看安装成功

# pip38 show jsonpath
Name: jsonpath
Version: 0.82
Summary: An XPath for JSON
Home-page: http://www.ultimate.com/phil/python/#jsonpath
Author: Phil Budne
Author-email: phil@ultimate.com
License: MIT
Location: /root/python3.8/lib/python3.8/site-packages
Requires: 
Required-by: 

标签:com,0.82,jsonpath,error,pip,python38,安装
来源: https://www.cnblogs.com/yoyoketang/p/16457801.html