我正在尝试通过pip安装this package。当我运行pip install flask-googlemaps
时,我看到通常的输出,并且包已成功安装,还有一些依赖项。如果我然后运行pip freeze
,我会看到列出的所有依赖项,但不是包本身。为什么呢?
以下是我的流程的全面细分。我测试了一个新的virtualenv,以确保我不只是错过它。
$ mkvirtualenv test1
New python executable in /Users/me/.virtualenvs/test1/bin/python2.7
Also creating executable in /Users/me/.virtualenvs/test1/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /Users/me/.virtualenvs/test1/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/me/.virtualenvs/test1/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/me/.virtualenvs/test1/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/me/.virtualenvs/test1/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/me/.virtualenvs/test1/bin/get_env_details
$ pip freeze
(no results, because nothing has been installed yet)
$ pip install flask-googlemaps
Collecting flask-googlemaps
Using cached Flask_GoogleMaps-0.2.5-py2.py3-none-any.whl
Collecting flask (from flask-googlemaps)
Using cached Flask-0.12.2-py2.py3-none-any.whl
Collecting Werkzeug>=0.7 (from flask->flask-googlemaps)
Using cached Werkzeug-0.12.2-py2.py3-none-any.whl
Collecting Jinja2>=2.4 (from flask->flask-googlemaps)
Using cached Jinja2-2.9.6-py2.py3-none-any.whl
Collecting click>=2.0 (from flask->flask-googlemaps)
Using cached click-6.7-py2.py3-none-any.whl
Collecting itsdangerous>=0.21 (from flask->flask-googlemaps)
Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->flask->flask-googlemaps)
Installing collected packages: Werkzeug, MarkupSafe, Jinja2, click, itsdangerous, flask, flask-googlemaps
Successfully installed Jinja2-2.9.6 MarkupSafe-1.0 Werkzeug-0.12.2 click-6.7 flask-0.12.2 flask-googlemaps itsdangerous-0.24
$ pip freeze
click==6.7
Flask==0.12.2
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
Werkzeug==0.12.2
请注意,flask-googlemaps不包含在第二个pip冻结输出中,但它的所有依赖项都是。
更奇怪的是,我现在可以完全使用该软件包。它已安装,它只是没有显示在pip冻结输出中。
答案 0 :(得分:4)
花了一些时间,但我追查了它。
如果你跑
pip install -v flask-googlemaps
你会在最后看到
Installing collected packages: Werkzeug, MarkupSafe, Jinja2, click, itsdangerous, flask, flask-googlemaps
Compiling /private/var/folders/2h/0dr8jftd1916yq_lp40__wzh0000gn/T/pip-build-avapA_/Jinja2/jinja2/asyncfilters.py ...
File "/private/var/folders/2h/0dr8jftd1916yq_lp40__wzh0000gn/T/pip-build-avapA_/Jinja2/jinja2/asyncfilters.py", line 7
async def auto_to_seq(value):
^
SyntaxError: invalid syntax
Compiling /private/var/folders/2h/0dr8jftd1916yq_lp40__wzh0000gn/T/pip-build-avapA_/Jinja2/jinja2/asyncsupport.py ...
File "/private/var/folders/2h/0dr8jftd1916yq_lp40__wzh0000gn/T/pip-build-avapA_/Jinja2/jinja2/asyncsupport.py", line 22
async def concat_async(async_gen):
^
SyntaxError: invalid syntax
为了证明这个错误是烧瓶谷歌地图没有出现在pip冻结的原因,我安装了以前的版本。
pip install flask-googlemaps==0.2.4
Collecting flask-googlemaps==0.2.4
Collecting Flask (from flask-googlemaps==0.2.4)
Using cached Flask-0.12.2-py2.py3-none-any.whl
Collecting Werkzeug>=0.7 (from Flask->flask-googlemaps==0.2.4)
Using cached Werkzeug-0.12.2-py2.py3-none-any.whl
Collecting Jinja2>=2.4 (from Flask->flask-googlemaps==0.2.4)
Using cached Jinja2-2.9.6-py2.py3-none-any.whl
Collecting click>=2.0 (from Flask->flask-googlemaps==0.2.4)
Using cached click-6.7-py2.py3-none-any.whl
Collecting itsdangerous>=0.21 (from Flask->flask-googlemaps==0.2.4)
Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->Flask->flask-googlemaps==0.2.4)
Installing collected packages: Werkzeug, MarkupSafe, Jinja2, click, itsdangerous, Flask, flask-googlemaps
Successfully installed Flask-0.12.2 Jinja2-2.9.6 MarkupSafe-1.0 Werkzeug-0.12.2 click-6.7 flask-googlemaps-0.2.4 itsdangerous-0.24
Pip冻结现在有效
pip freeze
click==6.7
Flask==0.12.2
Flask-GoogleMaps==0.2.4
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
Werkzeug==0.12.2
我刚刚代表您提交了GitHub issue。
答案 1 :(得分:1)
馄饨,
有趣的是你遇到了这个问题。我正在使用python 3.6并且没有运行错误
pip install -v flask-googlemaps
它完全安装,我可以使用该包。
我做了一点点,这就是我发现的:
site-packages具有以下条目:flask-googlemaps
flask_googlemaps
Flask-GoogleMaps-0.2.5-dist-info
我能够通过简单地重命名Flask-GoogleMaps-0.2.5-dist-info以匹配flask_googlemap的格式来显示pip冻结以显示flask-googlemaps:
davidj> mv Flask-GoogleMaps-0.2.5.dist-info Flask_GoogleMaps-0.2.5.dist-info
davidj> pip freeze
clickk==6.7
Flask==0.12.2
Flask-GoogleMaps==0.2.5
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
pkg-resources==0.0.0
Werkzeug==0.12.2
这样做之后,所有的pip函数都适用于包。
也许pip有一些必要的命名约定来将info目录映射到包目录....
答案 2 :(得分:1)
如果您安装了多个版本的python,则pip可能会对版本产生意外行为。请务必明确使用<div class="box">
<p class='title'>*****TITLE*****</p>
<div class="info">
<span>*****SUMMARY*****</span>
</div>
</div>
或pip2 install
,pip3 install
或pip2 freeze
来匹配您打算使用的python版本。
(注意:这个答案可能与OP的情况无关,但回答了问题&#34;为什么没有pip安装的软件包显示在pip冻结中?&#34 ;对于其他一些案例。)