2017-09-07 164 views
1

我正在嘗試通過pip安裝this package。當我運行pip install flask-googlemaps時,我看到了通常的輸出,並且軟件包已成功安裝,還有一些依賴關係。如果我運行pip freeze,我會看到列出的所有依賴關係,但不是包本身。爲什麼?爲什麼沒有pip安裝的包在pip freeze中顯示?

下面是我的過程的全面細分。我測試了一個新的virtualenv,以確保我不只是想念它。

  1. $ 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 
    
  2. $ pip freeze

    (no results, because nothing has been installed yet) 
    
  3. $ 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 
    
  4. $ pip freeze

    click==6.7 
    Flask==0.12.2 
    itsdangerous==0.24 
    Jinja2==2.9.6 
    MarkupSafe==1.0 
    Werkzeug==0.12.2 
    

注意燒瓶Google地圖不包括在所述第二籽冷凍輸出,但其所有相關的是。

更奇怪的是我現在可以完全使用這個軟件包了。它已安裝,它不會顯示在pip凍結輸出中。

回答

3

花了一些時間,但我追查下來。

如果您運行

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 

爲了證明這個錯誤的燒瓶Google地圖上沒有顯示畫中畫凍結起來的原因,我安裝了以前版。

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 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

+0

- 尼斯找到!謝謝您的幫助。 –

1

餛飩,

有趣的是,你遇到了這個問題。我正在使用Python 3.6並沒有運行錯誤

pip install -v flask-googlemaps 

它完全安裝,我可以使用該軟件包。

我做了一點閒逛,這就是我發現:

站點包有燒瓶的GoogleMaps

flask_googlemaps 
Flask-GoogleMaps-0.2.5-dist-info 

我能得到點子凍結顯示flask-以下條目谷歌地圖,只需重命名燒瓶的GoogleMaps-0.2.5-DIST-信息,以flask_googlemap的格式相匹配:這樣做後

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功能,工作在t他包。

也許PIP有一些必需的命名約定的信息目錄映射到包目錄....

0

如果您已經安裝了Python的多個版本,PIP可以相對於版本的意外行爲。確保明確使用pip2 installpip3 installpip2 freezepip3 freeze以與您打算使用的python版本匹配。

(注:這個答案可能是不相關的業務方案的情況下,卻可以回答這個問題:「爲什麼沒有點子安裝包PIP凍結露面」的其他一些情況下)