# -*- coding:utf-8 -*-
#! /usr/bin/env python3
import requests
#引入 requests 库
AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'
,
TypeError: 'int' object is not callable
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 900, in _find_spec
AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/noogler/Documents/python_files_sublimetext3/practice/draft7.py", line 3, in <module>
import requests
File "/usr/local/lib/python3.7/site-packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/usr/local/lib/python3.7/site-packages/urllib3/__init__.py", line 7, in <module>
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 11, in <module>
from .exceptions import (
File "/usr/local/lib/python3.7/site-packages/urllib3/exceptions.py", line 2, in <module>
from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 963, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 902, in _find_spec
File "<frozen importlib._bootstrap>", line 879, in _find_spec_legacy
File "<frozen importlib._bootstrap>", line 449, in spec_from_loader
File "/usr/local/lib/python3.7/site-packages/urllib3/packages/six.py", line 212, in is_package
return hasattr(self.__get_module(fullname), "__path__")
File "/usr/local/lib/python3.7/site-packages/urllib3/packages/six.py", line 116, in __getattr__
_module = self._resolve()
File "/usr/local/lib/python3.7/site-packages/urllib3/packages/six.py", line 113, in _resolve
return _import_module(self.mod)
File "/usr/local/lib/python3.7/site-packages/urllib3/packages/six.py", line 82, in _import_module
__import__(name)
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 71, in <module>
import email.parser
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/email/feedparser.py", line 27, in <module>
from email._policybase import compat32
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/email/_policybase.py", line 9, in <module>
from email.utils import _has_surrogates
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/email/utils.py", line 33, in <module>
from email._parseaddr import quote
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/email/_parseaddr.py", line 16, in <module>
import time, calendar
File "/Users/noogler/Documents/python_files_sublimetext3/practice/calendar.py", line 9, in <module>
cal = calendar.month(year,month)
TypeError: 'int' object is not callable
[Finished in 0.1s with exit code 1]
[cmd: ['/usr/local/bin/python3', '-u', '/Users/noogler/Documents/python_files_sublimetext3/practice/draft7.py']]
[dir: /Users/noogler/Documents/python_files_sublimetext3/practice]
[path: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/aria2/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands]
import pygame 库是正常的
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
[Finished in 0.2s]
初学 python 不久,不确定还需要补充哪些信息帮忙定位,我会继续补充 自己 Google 了 2 天了还是没解决,希望有好心大佬帮忙,感激不尽 😂
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.