[問題] VS code 找不到library

看板Python作者 (閒學生)時間7年前 (2018/01/22 22:30), 編輯推噓4(4011)
留言15則, 6人參與, 7年前最新討論串1/1
抱歉打擾各位 我目前作業環境為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() -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.125.96.131 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1516631453.A.FFB.html

01/23 01:41, 7年前 , 1F
猜是VS code沒有得到conda的環境 讀到是原本Ubuntu內建
01/23 01:41, 1F

01/23 01:41, 7年前 , 2F
01/23 01:41, 2F

01/23 02:42, 7年前 , 3F
確認你終端機默認的python是不是conda和版本確認
01/23 02:42, 3F

01/23 02:43, 7年前 , 4F
或是你前面要先import numpy?
01/23 02:43, 4F

01/23 02:44, 7年前 , 5F
第二個是我猜測 我感覺應該不用
01/23 02:44, 5F

01/23 08:44, 7年前 , 6F
先試試看在外面終端機直接打有沒有這個套件
01/23 08:44, 6F

01/23 12:57, 7年前 , 7F
有喔我用spyder是可以跑出結果的。然後numpy-stl是我第
01/23 12:57, 7F

01/23 12:57, 7年前 , 8F
一個找不到的套件,之前的tensorflow是可以的
01/23 12:57, 8F

01/24 20:41, 7年前 , 9F
從終端機開vs-code看看 我之前用pytube有遇過類似的
01/24 20:41, 9F

01/25 18:08, 7年前 , 10F
我一直都是使用terminal開啟VS code 剛剛重開之後確認
01/25 18:08, 10F

01/25 18:09, 7年前 , 11F
還是找不到==但是ipython可以...
01/25 18:09, 11F

01/25 22:29, 7年前 , 12F
重裝看看?
01/25 22:29, 12F

01/29 17:01, 7年前 , 13F
重新安裝後還是一樣...放棄
01/29 17:01, 13F

02/13 21:00, 7年前 , 14F
之前好像有看到說是pylint的問題 不知道跟你的狀況有沒
02/13 21:00, 14F

02/13 21:00, 7年前 , 15F
有關
02/13 21:00, 15F
文章代碼(AID): #1QPVMT_x (Python)
文章代碼(AID): #1QPVMT_x (Python)