我正在開發一個項目,可以播放csv文件,但是我不能讓熊貓工作。到目前爲止,我研究過的一切都告訴我要確保安裝熊貓。使用pip我已經成功安裝了熊貓。當我嘗試運行我的Python程序和進口熊貓,我得到:如果我的熊貓安裝正確,爲什麼我的導入語句不能識別它?
Traceback (most recent call last):
File "analysis.py", line 1, in <module>
import pandas as pd
ImportError: No module named pandas
我不知道這是相關的,但我想看看是否這將與conda install pandas
不過,我得到這個工作,進口錯誤:
(同樣,巨蟒是否正確安裝我的系統上)
Traceback (most recent call last):
File "/usr/local/bin/conda", line 9, in <module>
load_entry_point('conda==4.2.7', 'console_scripts', 'conda')()
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 561, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2627, in load_entry_point
return ep.load()
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2287, in load
return self.resolve()
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2293, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/Library/Python/2.7/site-packages/conda/cli/__init__.py", line 8, in <module>
from .main import main # NOQA
File "/Library/Python/2.7/site-packages/conda/cli/main.py", line 46, in <module>
from ..base.context import context
File "/Library/Python/2.7/site-packages/conda/base/context.py", line 18, in <module>
from ..common.configuration import (Configuration, MapParameter, PrimitiveParameter,
File "/Library/Python/2.7/site-packages/conda/common/configuration.py", line 40, in <module>
from ruamel.yaml.comments import CommentedSeq, CommentedMap # pragma: no cover
ImportError: No module named ruamel.yaml.comments
任何人都有類似的經歷導入庫?我試圖確保我擁有Python3的正確版本,但似乎並不是問題所在。任何幫助將不勝感激!謝謝。
你巨蟒就是Python 2.7,和你使用的python是3.x.這正是問題所在。 – DyZ
這會影響熊貓的進口嗎?我如何獲得anaconda默認使用python 3?我似乎也無法讓它工作。 –
只要使用'conda'也不會自行工作。它沒有意義,因爲它在過去有效。 –