[问题] VS code 找不到library

楼主: owem0410 (闲学生)   2018-01-22 22:30:50
抱歉打扰各位
我目前作业环境为Ubuntu 16.04
套件用conda 管理
今天想要尝试numpy-stl套件
下述范例读取.stl档
使用Vs code 却有ImportError: No module named stl
但是我在vs code里终端机里打conda list有看到numpy-stl
所以我是那边没有设定好?
读取范例程式码:
from stl import mesh
from mpl_toolkits import mplot3d
from matplotlib import pyplot
# Create a new plot
figure = pyplot.figure()
axes = mplot3d.Axes3D(figure)
# Load the STL files and add the vectors to the plot
your_mesh = mesh.Mesh.from_file('/home/chen/sample3.stl')
axes.add_collection3d(mplot3d.art3d.Poly3DCollection(your_mesh.vectors))
# Auto scale to the mesh size
scale = your_mesh.points.flatten(-1)
axes.auto_scale_xyz(scale, scale, scale)
# Show the plot to the screen
pyplot.show()
作者: TitanEric (泰坦)   2018-01-23 01:41:00
猜是VS code没有得到conda的环境 读到是原本Ubuntu内建的
作者: handsomeLin (DoGLin)   2018-01-23 02:42:00
确认你终端机默认的python是不是conda和版本确认或是你前面要先import numpy?第二个是我猜测 我感觉应该不用
作者: AndyLee76 (AndyLee)   2018-01-23 08:44:00
先试试看在外面终端机直接打有没有这个套件
楼主: owem0410 (闲学生)   2018-01-23 12:57:00
有喔我用spyder是可以跑出结果的。然后numpy-stl是我第一个找不到的套件,之前的tensorflow是可以的
作者: craig1122321 (半醉夜猫)   2018-01-24 20:41:00
从终端机开vs-code看看 我之前用pytube有遇过类似的
楼主: owem0410 (闲学生)   2018-01-25 18:08:00
我一直都是使用terminal开启VS code 刚刚重开之后确认还是找不到==但是ipython可以...
作者: craig1122321 (半醉夜猫)   2018-01-25 22:29:00
重装看看?
楼主: owem0410 (闲学生)   2018-01-29 17:01:00
重新安装后还是一样...放弃
作者: nicks0904 (James)   2018-02-13 21:00:00
之前好像有看到说是pylint的问题 不知道跟你的状况有没有关

Links booklink

Contact Us: admin [ a t ] ucptt.com