Python 3.5.1 urllib has no attribute request

后端 未结 6 1495
礼貌的吻别
礼貌的吻别 2020-12-17 08:19

I have tried

import urllib.request

or

import urllib

The path for my urllib is /Library/Framework

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-17 08:39

    I had the same issue. I'm using Python 3.8.2.

    I checked the _init_.py file located at /usr/lib/python3.8/urllib/ and its empty, which means you can not make a fully qualified access using only import urllib. In this case, you have to use import urllib.request.

提交回复
热议问题