我已经尝试使用命令遵循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=BlueJeansMeetingsRestApi
附加到Git上。项目网址。如果我立即这样做,就会得到“已经满足要求”:
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
首先不起作用?答案 0 :(得分:1)
要卸载软件包,只需使用
pip uninstall BlueJeansMeetingsRestApi
如果IPYTHON出现一些配置问题,您可能会遇到此类错误。
但是,如果您的时间很短,我建议使用python shell命令直接使用shell,我认为当您尝试将其导入文件时,它应该可以工作。
python <filename>.py
请检查并告知我。
答案 1 :(得分:0)
要总结CoderRambo和tgikal的答复,是的,我能够以这种方式卸载BlueJeansMeetingsRestApi
:
Kurts-MacBook-Pro-2:~ kurtpeek$ pip uninstall BlueJeansMeetingsRestApi
Uninstalling BlueJeansMeetingsRestApi-1.0.0:
Would remove:
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/BlueJeansMeetingsRestApi-1.0.0-py3.7.egg-info
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/BlueJeansMeetingsRestApi/*
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/test/*
Proceed (y/n)? y
Successfully uninstalled BlueJeansMeetingsRestApi-1.0.0
但是,问题的根源是iPython运行在Python 3.6上,而BlueJeans安装在Python 3.7上。我通过使用which ipython
确认了这一点:
Kurts-MacBook-Pro-2:~ kurtpeek$ which ipython
/Library/Frameworks/Python.framework/Versions/3.6/bin/ipython
我运行了pip install ipython
,现在它指向的是Python 3.7:
Kurts-MacBook-Pro-2:~ kurtpeek$ which ipython
/Library/Frameworks/Python.framework/Versions/3.7/bin/ipython
然后我重新安装了BlueJeans REST API(未指定鸡蛋),现在我可以导入它了:
Kurts-MacBook-Pro-2:~ kurtpeek$ ipython
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import BlueJeansMeetingsRestApi
In [2]: