推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
vtoexsir
V2EX  ›  Python

win7 64 位,安装 urllib 老是报错?

  •  
  •   vtoexsir · Jun 10, 2017 · 6048 views
    This topic created in 3442 days ago, the information mentioned may be changed or developed.

    系统:win7 64 位
    python 3.6.3 32 位

    错误如下:

    `D:\jianguoyun\pythonProgrames3
    λ pip3 install urllib
    Collecting urllib
    Downloading https://pypi.tuna.tsinghua.edu.cn/packages/da/97/7ed06ae96106088e13e 88fd6f91c17fb58786d705b851f82c991664b08db/urllib-1.21.1.tar.gz (226kB)
    100% |████████████████████████████████| 235kB 1.4MB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-build-8yb3sik_\urllib\setup.p y", line 191
    s.connect((base64.b64decode(rip), 017620))
    ^
    SyntaxError: invalid token

    ----------------------------------------                                      
    

    Command "python setup.py egg_info" failed with error code 1 in C:\Users\ADMINI~1\A ppData\Local\Temp\pip-build-8yb3sik_\urllib\
    `

    请各位看看该怎么弄呢?
    多谢!

    11 replies  •  2017-06-11 21:39:10 +08:00
    zetary
    zetary
    Jun 10, 2017
    1
    要在 Windows 上弄建议直接上 anaconda
    ivechan
    ivechan
    Jun 10, 2017
    2
    使用第三方源安装失败首先尝试停用第三方源,然后清除缓存,重新安装,
    如果你的 python 安装目录属于 UAC 保护范围内, 还要尝试使用管理员模式运行 CMD。

    仅供参考。
    mittya
    mittya
    Jun 10, 2017
    3
    问个题外话,urllib 还要再安装?
    xmi
    xmi
    Jun 10, 2017
    4
    偏下题,刚在 SegmentFault 也看到你的提问了~
    lzhr
    lzhr
    Jun 10, 2017
    5
    pip3 install urllib3
    stanfordwang
    stanfordwang
    Jun 10, 2017 via Android
    6
    urllib3
    visualwind
    visualwind
    Jun 11, 2017
    7
    python3 自带了 urllib3 吧。urllib 是 py2 用的,是安装不了的
    wwqgtxx
    wwqgtxx
    Jun 11, 2017 via iPhone
    8
    @visualwind python3 把原来的 urllib 和 urllib2 合并为 urllib 了,而 urllib3 是另外一个第三方库,和 python3 本身没关系
    vtoexsir
    vtoexsir
    OP
    Jun 11, 2017
    9
    多谢各位了!
    我的本意是想将一段文本进行 urlencode,看到 urllib 有这个方法,但我在 python3 里的 urllib 里却找不到该方法。然后在 pip package 里查到 urllib,想要安装。
    在 python3 里,urllib 是不需要安装的。
    TJT
    TJT
    Jun 11, 2017
    10
    Python3 不是自带的么

    In [12]: __import__('urllib').__file__
    Out[12]: '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/__init__.py'
    ltux
    ltux
    Jun 11, 2017
    11
    urlencode() 在 urllib.parse 模块里。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4395 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 07:56 · PVG 15:56 · LAX 23:56 · JFK 02:56
    ♥ Do have faith in what you're doing.