我正在尝试使用azurejupyter笔记本打开拼花板文件。我尝试过Python内核(2和3)。
安装pyarrow后,只有当Python内核为2时,我才能导入模块(不能使用python3)
以下是我到目前为止所做的(为了清楚起见,我没有提到我所有的尝试,例如使用conda而不是pip,因为它也失败了):!pip install --upgrade pip
!pip install -I Cython==0.28.5
!pip install pyarrow
import pandas
import pyarrow
import pyarrow.parquet
#so far, so good
filePath_parquet = "foo.parquet"
table_parquet_raw = pandas.read_parquet(filePath_parquet, engine='pyarrow')
如果我离线(使用Spyder,PythonV.3.7.0),这很好用。但是使用Azure笔记本会失败。在
^{pr2}$
有什么想法吗?在
提前谢谢你!在
编辑:
非常感谢您的回复彼得潘!
我已经打印了这些声明,以下是我得到的:
1。在print(pandas.__dict__)
=>;read_parquet不出现
2。在print(pandas.__file__)
=>;我得到:/home/nbuser/anaconda3_23/lib/python3.4/site-packages/pandas/__init__.py导入系统;打印(搜索路径)=>;我得到:['', '/home/nbuser/anaconda3_23/lib/python34.zip',
'/home/nbuser/anaconda3_23/lib/python3.4',
'/home/nbuser/anaconda3_23/lib/python3.4/plat-linux',
'/home/nbuser/anaconda3_23/lib/python3.4/lib-dynload',
'/home/nbuser/.local/lib/python3.4/site-packages',
'/home/nbuser/anaconda3_23/lib/python3.4/site-packages',
'/home/nbuser/anaconda3_23/lib/python3.4/site-packages/Sphinx-1.3.1-py3.4.egg',
'/home/nbuser/anaconda3_23/lib/python3.4/site-packages/setuptools-27.2.0-py3.4.egg',
'/home/nbuser/anaconda3_23/lib/python3.4/site-packages/IPython/extensions',
'/home/nbuser/.ipython']
你知道吗?在
编辑2:
亲爱的@PeterPan,我已经输入了!conda update conda和{}:当检查Pandas版本(pandas.__version__)时,它仍然是{}。在
我也尝试过使用!conda update pandas -y -f,它返回:
`正在获取包元数据。。。。。。。。。。。
正在解决包规范:。在
环境/住宅/nbuser/anaconda3_23中的安装包计划:
将安装以下新软件包:pandas: 0.19.2-np111py34_1`
键入时:
!pip install --upgrade pandas
我得到:
Requirement already up-to-date: pandas in /home/nbuser/anaconda3_23/lib/python3.4/site-packages
Requirement already up-to-date: pytz>=k in /home/nbuser/anaconda3_23/lib/python3.4/site-packages (from pandas)
Requirement already up-to-date: numpy>=1.9.0 in /home/nbuser/anaconda3_23/lib/python3.4/site-packages (from pandas)
Requirement already up-to-date: python-dateutil>=2 in /home/nbuser/anaconda3_23/lib/python3.4/site-packages (from pandas)
Requirement already up-to-date: six>=1.5 in /home/nbuser/anaconda3_23/lib/python3.4/site-packages (from python-dateutil>=2->pandas)
最后,键入时:
!pip install --upgrade pandas==0.24.0
我得到:
Collecting pandas==0.24.0
Could not find a version that satisfies the requirement pandas==0.24.0 (from versions: 0.1, 0.2b0, 0.2b1, 0.2, 0.3.0b0, 0.3.0b2, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.6.0, 0.6.1, 0.7.0rc1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0rc1, 0.8.0rc2, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.16.1, 0.16.2, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0rc1, 0.19.0, 0.19.1, 0.19.2, 0.20.0rc1, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.21.0rc1, 0.21.0, 0.21.1, 0.22.0)
No matching distribution found for pandas==0.24.0
因此,我猜测问题来自于Azure中包的管理方式。更新一个包(这里是Pandas),应该会导致更新到可用的最新版本,不是吗?在