Python3:TypeError:'模块'对象不可呼应
我一直在尝试在Mac终端上运行一些Python,并且我遇到了以下错误:“ TypeError:'Module'对象不可呼应”
参考代码:
import re
import pathlib as Path
mypath = Path('users/pranav/Desktop/sir/samplenames.txt')
有人可以为我分解错误并解释我应该做什么。要解决吗?
我还尝试使用SYS对其进行修复,但是,在我什至可以通过它进行工作之前,我被返回了一个错误:attributeError:'list'对象没有属性'dirname'code
w/ sys:
import sys
print(sys.path.dirname())
import re
import pathlib as Path
mypath = Path('/users/pranav/Desktop/sir/samplenames.txt')
任何帮助都将不胜感激。
I keep trying to run a bit of python on mac terminal, and I'm hit with the following error: "TypeError: 'module' object is not callable"
Reference code:
import re
import pathlib as Path
mypath = Path('users/pranav/Desktop/sir/samplenames.txt')
Could someone break down the error for me and explain what I should do to fix it?
I also tried to fix it using sys, however, before I could even work through it I was returned an error stating: AttributeError: 'list' object has no attribute 'dirname'
Code w/ sys:
import sys
print(sys.path.dirname())
import re
import pathlib as Path
mypath = Path('/users/pranav/Desktop/sir/samplenames.txt')
Any help would be greatly appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)