[問題] import pandas to python

看板Programming作者 (....)時間10年前 (2015/06/20 04:37), 10年前編輯推噓6(6034)
留言40則, 5人參與, 最新討論串1/1
I am a new python user I've installed pandas using the method in following website, http://askubuntu.com/questions/70883/how-do-i-install-python-pandas and tried importing pandas onto my python import pandas frame = pandas.DataFrame() however, an error came out ImportError: No module named pandas I did this under python >>> How can I fix the problem? I am using Ubuntu 15.04 and Python 2.7.9 thank you Best, -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 107.15.112.169 ※ 文章網址: https://www.ptt.cc/bbs/Programming/M.1434746260.A.8B8.html ※ 編輯: dreler1 (107.15.112.169), 06/20/2015 04:40:35

06/20 12:51, , 1F
pip install pandas
06/20 12:51, 1F

06/20 14:49, , 2F
懶的一個一個裝的話可以裝python xy
06/20 14:49, 2F

06/20 14:49, , 3F
(2.7版要移除比較不會干擾), 內建許
06/20 14:49, 3F

06/20 14:49, , 4F
多常用科研數學套件以及spyder IDE
06/20 14:49, 4F

06/20 14:49, , 5F
跟Ipython, numpy scipy 什麼的一
06/20 14:49, 5F

06/20 14:49, , 6F
次搞定
06/20 14:49, 6F

06/20 14:51, , 7F
另外 假如要用"pip"的安裝功能,要
06/20 14:51, 7F

06/20 14:51, , 8F
先安裝pip,不然console一樣會報錯
06/20 14:51, 8F

06/22 04:53, , 9F
我移除 python 2.7 電腦就 GG了 剛重灌
06/22 04:53, 9F

06/22 04:53, , 10F
sudo apt-get remove python 2.7
06/22 04:53, 10F

06/22 04:54, , 11F
結果好多東西一起被移除了 只好重灌
06/22 04:54, 11F

06/22 04:54, , 12F
晚點 來試試 不移除看會有什麼干擾
06/22 04:54, 12F

06/22 04:54, , 13F
謝謝了
06/22 04:54, 13F

06/22 04:56, , 14F
照 網頁方法
06/22 04:56, 14F

06/22 04:57, , 15F
sudo apt-get install python-pip
06/22 04:57, 15F

06/22 04:57, , 16F
sudo pip install numpy
06/22 04:57, 16F

06/22 04:57, , 17F
sudo pip install pandas
06/22 04:57, 17F

06/22 04:57, , 18F
我import 進去 還是找不到 module 怎麼會
06/22 04:57, 18F

06/23 08:57, , 19F
安裝完要看console的報告,有時候安
06/23 08:57, 19F

06/23 08:57, , 20F
裝失敗他會告訴你原因,我通常都用
06/23 08:57, 20F

06/23 08:58, , 21F
sudo apt-get install python-panda
06/23 08:58, 21F

06/23 08:58, , 22F
s
06/23 08:58, 22F

06/23 08:59, , 23F
個人覺得windows下pip才比較管用,
06/23 08:59, 23F

06/23 08:59, , 24F
很多時候Linux下我pip install都失
06/23 08:59, 24F

06/23 09:00, , 25F
敗,若一直失敗不妨嘗試直接去抓官
06/23 09:00, 25F

06/23 09:01, , 26F
方網站的安裝包回來解壓縮用
06/23 09:01, 26F

06/23 09:02, , 27F
cd .../pkg_path
06/23 09:02, 27F

06/23 09:02, , 28F
sudo python setup.py install
06/23 09:02, 28F

06/23 09:03, , 29F
來安裝
06/23 09:03, 29F

06/23 09:25, , 30F
有時候會失敗是編譯 C/C++ 等沒過
06/23 09:25, 30F

06/23 21:37, , 31F
OK 謝謝
06/23 21:37, 31F

06/24 12:30, , 32F
thanks that works,
06/24 12:30, 32F

06/24 12:30, , 33F
how can we fix the pip
06/24 12:30, 33F

06/24 12:31, , 34F
if the problem is related to C compile
06/24 12:31, 34F

06/24 18:45, , 35F
有時候要裝相關函式庫才會編譯成功
06/24 18:45, 35F

06/24 18:45, , 36F
所以用 apt-get 裝會比較簡單
06/24 18:45, 36F

06/25 00:26, , 37F
通常 pip 報錯通常跟樓上講的一樣
06/25 00:26, 37F

06/25 00:27, , 38F
少某些.h檔,直接google報錯的部份
06/25 00:27, 38F

06/25 00:27, , 39F
,把該裝的裝一裝通常就過了。
06/25 00:27, 39F

07/06 17:21, , 40F
有Python版XD
07/06 17:21, 40F
文章代碼(AID): #1LX7sKYu (Programming)
文章代碼(AID): #1LX7sKYu (Programming)