ImportError:无法导入名称' urlencode'在尝试安装flask.ext.storage时

时间:2017-05-17 17:34:09

标签: python-3.x pip urlencode flask-extensions

我正在使用Python 3.5.1 / Window 8.1

>> pip install -e git://github.com/kvesteri/flask-storage.git#egg=Flask-Storage

结果如下:

Obtaining Flask-Storage from git+git://github.com/kvesteri/flask-storage.git#egg=Flask-Storage
  Updating c:\users\rodolfo\desktop\dumppython\flask\venv\src\flask-storage clone
Requirement already satisfied: Flask>=0.7 in c:\users\rodolfo\desktop\dumppython\flask\venv\lib\site-packages (from Flask-Storage)
Requirement already satisfied: boto>=2.5.2 in c:\users\rodolfo\desktop\dumppython\flask\venv\lib\site-packages (from Flask-Storage)
Collecting python-cloudfiles>=1.7.10 (from Flask-Storage)
  Using cached python-cloudfiles-1.7.11.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Rodolfo\AppData\Local\Temp\pip-build-t2cefnr2\python-cloudfiles\setup.py", line 6, in <module>
        from cloudfiles.consts import __version__
      File "C:\Users\Rodolfo\AppData\Local\Temp\pip-build-t2cefnr2\python-cloudfiles\cloudfiles\__init__.py", line 82, in <module>
        from cloudfiles.connection     import Connection, ConnectionPool
      File "C:\Users\Rodolfo\AppData\Local\Temp\pip-build-t2cefnr2\python-cloudfiles\cloudfiles\connection.py", line 13, in <module>
        from    urllib    import urlencode
    ImportError: cannot import name 'urlencode'

2 个答案:

答案 0 :(得分:11)

  

urllib模块已拆分为多个部分,并在Python 3中重命名为   urllib.request,urllib.parse和urllib.error。

[来自https://docs.python.org/2/library/urllib.html]

所以在Python 2中它是:

from urllib import urlencode

在Python 3中它是:

from urllib.parse import urlencode

答案 1 :(得分:0)

<块引用>

块引用 检查不同版本

pip install Werkzeug==0.14.1