【发布时间】:2019-01-04 20:04:00
【问题描述】:
我尝试按照 BlueJeans 会议 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(pip 是 pip3 的别名)。
我有两个问题:
- 为什么
import BlueJeansMeetingsRestApi一开始就不起作用? - 如何卸载它?
【问题讨论】:
-
您是否尝试使用与它安装到的相同版本的 python 导入它?我的意思是看起来你使用的是 3.6.5 版本,如果它安装到 3.7,那么它将看不到它。安装多个版本时,我已经多次遇到这种情况。