ERROR: Could not build wheels for pandas, which is required to install pyproject.toml-based projects
我也遇到这个问题,我查了一下,python 支持直接走本地安装
- 把 d2l-1.0.0b0-py3-none-any.whl下载到本地:d2l · PyPI
- 根据官方文档按以下命令安装,路径换成你的下载路径,如:
py -m pip install "C:\Users\xxx\Downloads\d2l-1.0.0b0-py3-none-any.whl"
- 再运行一遍
pip install d2l==0.17.6
让 pip 把本地安装的包对应上 d2l 名称,测试 import d2l 就可以成功了
亲测有效
我整理成了一篇文章,详见:解决 Could not build wheels for pandas, which is required to install pyproject.toml-based projects_sriting的博客-CSDN博客
每次启动notebook之前都要activate吗?
确实有时候python版本过高是个问题,比如我更新为python 3.11后,旧版本的torch 1.12就用不了了
好像是因为Jupyter的路径问题。
试试:
~/.local/bin/jupyter notebook
22 from pandas.compat.numpy import (
23 np_version_under1p17 as _np_version_under1p17,
24 np_version_under1p18 as _np_version_under1p18,
25 is_numpy_dev as _is_numpy_dev,
26 )
28 try:
---> 29 from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
30 except ImportError as e: # pragma: no cover
...
22 )
File pandas/_libs/interval.pyx:1, in init pandas._libs.interval()
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
这个版本不兼容大家是怎么解决的呀,大家使用的 numpy,pandas,d2l, python 都是什么版本呀
pip install jupyter d2l 后报错,请问这个要怎么解决啊?
error: command ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe’ failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pandas
Failed to build matplotlib numpy pandas
ERROR: Could not build wheels for numpy, pandas, which is required to install pyproject.toml-based projects
各位别像我一样耍小聪明用 python 3.10, 当前 d2l包和相关依赖只支持Python 3.9
Python 的 版本装错了, 只能装 python 3.9,然后 pandas 的版本得退回到 1.2.4
参照文档,M2机器,在python3.9下,
pip install torch==1.12.0
pip install torchvision==0.13.0
pip install d2l==0.17.6
执行导入d2l包之后报错
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[1], line 6
4 import torch
5 from torch import nn
----> 6 from d2l import torch as d2l
File ~/anaconda3/envs/d2l4/lib/python3.9/site-packages/d2l/torch.py:32
30 import zipfile
31 from collections import defaultdict
---> 32 import pandas as pd
33 import requests
34 from IPython import display
File ~/anaconda3/envs/d2l4/lib/python3.9/site-packages/pandas/__init__.py:29
22 from pandas.compat.numpy import (
23 np_version_under1p17 as _np_version_under1p17,
24 np_version_under1p18 as _np_version_under1p18,
25 is_numpy_dev as _is_numpy_dev,
26 )
28 try:
---> 29 from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
30 except ImportError as e: # pragma: no cover
31 # hack but overkill to use re
32 module = str(e).replace("cannot import name ", "")
File ~/anaconda3/envs/d2l4/lib/python3.9/site-packages/pandas/_libs/__init__.py:13
1 __all__ = [
2 "NaT",
3 "NaTType",
(...)
9 "Interval",
10 ]
---> 13 from pandas._libs.interval import Interval
14 from pandas._libs.tslibs import (
15 NaT,
16 NaTType,
(...)
21 iNaT,
22 )
File pandas/_libs/interval.pyx:1, in init pandas._libs.interval()
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
同样报错,兄弟解决了嘛。。。。。。。。。。
还在吗,我是这样弄好的
pip install d2l ——> pip install d2l pandas==1.5.3
运行代码jupyter notebook后显示,‘jupyter’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。请问这里应该如何解决?
Why is it that my CUDA is installed, but I can’t call it in my program. Entering nvcc -V in cmd displays the version number correctly, and the cuDNN files are configured according to the tutorial.
如果没有独立显卡,已安装conda或miniconda后,通过如下命令安装pytorch:
conda install pytorch torchvision torchaudio cpuonly -c pytorch