簡體   English   中英

熊貓在python3中不起作用,但在python中起作用

[英]Pandas not working in python3 but works in python

我試圖在python3運行pandas。 但是我收到以下錯誤。

user@client3:~/smith/Python$ python3
Python 3.7.0 (default, Oct  3 2018, 21:22:25) 
[GCC 5.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pandas'

所以我嘗試從python運行,

user@client3:~/smith/Python$ python
Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> exit()

它在這里工作正常。 所以我嘗試如下安裝python3熊貓,

user@client3:~/smith/Python$ sudo apt-get install python3-pandas
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-pandas is already the newest version (0.17.1-3ubuntu2).
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-139 linux-headers-4.4.0-139-generic linux-image-4.4.0-139-generic linux-image-extra-4.4.0-139-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.

它已經為python3安裝了。 這里發生了什么? 為什么它不能在python3上運行?

這應該可以工作,請檢查一下。

pip3 install pandas

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM