gpt4 book ai didi

python - 如何 pip 卸载使用 git 项目 URL 安装的包?

转载 作者:行者123 更新时间:2023-12-01 09:12:14 28 4
gpt4 key购买 nike

我已尝试使用以下命令按照 BlueJeans session REST API ( https://github.com/bluejeans/api-rest-meetings/tree/master/libs/python ) 的安装说明进行操作

pip install git+https://github.com/bluejeans/api-rest-meetings.git@pip-repo

pip freeze 命令确认我已安装它:

Kurts-MacBook-Pro-2:~ kurtpeek$ pip freeze
BlueJeansMeetingsRestApi==1.0.0
certifi==2018.4.16
python-dateutil==2.7.3
six==1.11.0
urllib3==1.23

但是,在 iPython shell 中,我无法导入 BlueJeansMeetingsRestApi:

Kurts-MacBook-Pro-2:~ kurtpeek$ ipython
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import BlueJeansMeetingsRestApi
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-0891de0c20ce> in <module>()
----> 1 import BlueJeansMeetingsRestApi

ModuleNotFoundError: No module named 'BlueJeansMeetingsRestApi'

这是在我的本地环境中,但我也将其安装在 Pipenv 中环境,在这种情况下,我需要提供一个 Egg,我通过将 #egg=BlueJeansMeetingsRestApi 附加到 Git 项目 URL 来实现。如果我立即执行此操作,我会得到“已满足要求”:

Kurts-MacBook-Pro-2:~ kurtpeek$ pip install git+https://github.com/bluejeans/api-rest-meetings.git@pip-repo#egg=BlueJeansMeetingsRestApi
Requirement already satisfied: BlueJeansMeetingsRestApi from git+https://github.com/bluejeans/api-rest-meetings.git@pip-repo#egg=BlueJeansMeetingsRestApi in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (1.0.0)
Requirement already satisfied: urllib3>=1.15 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from BlueJeansMeetingsRestApi) (1.23)
Requirement already satisfied: six>=1.10 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from BlueJeansMeetingsRestApi) (1.11.0)
Requirement already satisfied: certifi in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from BlueJeansMeetingsRestApi) (2018.4.16)
Requirement already satisfied: python-dateutil in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from BlueJeansMeetingsRestApi) (2.7.3)

因此,我想尝试先卸载BlueJeans,然后重新安装它并指定egg。但是,如果我尝试使用相同的项目 URL 卸载它,则会收到以下错误:

Kurts-MacBook-Pro-2:~ kurtpeek$ pip uninstall git+https://github.com/bluejeans/api-rest-meetings.git@pip-repo
You must give at least one requirement to uninstall (see "pip help uninstall")

顺便说一下,我使用的是 Python 3.7.0(pippip3 的别名)。

我有两个问题:

  1. 为什么 import BlueJeansMeetingsRestApi 一开始就不起作用?
  2. 如何卸载它?

最佳答案

要卸载软件包,只需使用

pip uninstall BlueJeansMeetingsRestApi

如果 IPYTHON 存在一些配置问题,您可能会遇到此类错误。

但是如果你的时间不够,我建议你使用直接的 python shell 命令 shell,我认为当你尝试将它导入到文件中时这应该可以工作。

python <filename>.py

请检查并告诉我。

关于python - 如何 pip 卸载使用 git 项目 URL 安装的包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51562320/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com