在控制台遇到了一个问题

来源:2-3 实现属于我们自己的向量

慕移动3624030

2018-11-28

Last login: Tue Nov 27 13:08:36 on ttys001
wonderdeMacBook-Pro:~ wonder$ cd DestTop
-bash: cd: DestTop: No such file or directory
wonderdeMacBook-Pro:~ wonder$ cd DeskTop/
wonderdeMacBook-Pro:DeskTop wonder$ cd Liner-A-Learning/
wonderdeMacBook-Pro:Liner-A-Learning wonder$ cd LinearAlgebra/
wonderdeMacBook-Pro:LinearAlgebra wonder$ cd playLA/
wonderdeMacBook-Pro:playLA wonder$ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

from playLA.Vector import Vector
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘playLA’

import Vector
u = Vector({5,2})
Traceback (most recent call last):
File “”, line 1, in
TypeError: ‘module’ object is not callable

u=([5,2])
u=Vector([5,2])
Traceback (most recent call last):
File “”, line 1, in
TypeError: ‘module’ object is not callable

u = Vector([5,2])
Traceback (most recent call last):
File “”, line 1, in
TypeError: ‘module’ object is not callable

u=5
u
5

u=Vector()
Traceback (most recent call last):
File “”, line 1, in
TypeError: ‘module’ object is not callable

u = Vector([5,2])
Traceback (most recent call last):
File “”, line 1, in
TypeError: ‘module’ object is not callable

Vector.version
Traceback (most recent call last):
File “”, line 1, in
AttributeError: module ‘Vector’ has no attribute ‘version’

u = Vector([1,1,1,1])
Traceback (most recent call last):
File “”, line 1, in
TypeError: ‘module’ object is not callable

在控制台中出现的问题,无法执行命令是怎么回事呢

写回答

1回答

liuyubobobo

2018-11-28

你的当前路径已经进入playLA内部了,就无法import playLA了。playLA这个文件夹里面没有playLA模块。


你需要在playLA外面,根据你提供的信息,LinearAlgebra这个文件夹下,import playLA,才能找到:)


加油!:)

0
1
慕移动3624030
试了几次解决了,谢谢bobo老师及时回答!
2018-11-28
共1条回复

结合编程学数学 专为程序员设计的线性代数

创新设计,通俗易懂。编程结合数学,bobo带你彻底征服线性代数

3404 学习 · 375 问题

查看课程