笔记本上安装的Python3.10.8,安装mayavi后运行代码一直提示“TypeError: unhashable type: ‘PolyData’ ”,试了很多版本都不合适。
觉得可能和已经安装的其他库有关系,想删除了重新安装。
首先,以管理员身份运行cmd,否则可能会出现拒绝访问。
1.pip freeze > requirements.txt
上述命令可以 将已安装的库信息保存到requirements.txt中
这是已安装的库:
aiofiles==23.2.1
aiohappyeyeballs==2.4.6
aiohttp==3.11.12
aiosignal==1.3.2
annotated-types==0.7.0
anyio==4.2.0
apptools==5.3.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-lru==2.0.4
async-timeout==5.0.1
attrs==23.1.0
Babel==2.14.0
beautifulsoup4==4.12.2
bleach==6.1.0
certifi==2023.11.17
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.8
colorama==0.4.6
comm==0.2.0
configobj==5.0.9
contourpy==1.3.1
cycler==0.12.1
datasets==3.2.0
debugpy==1.8.0
decorator==5.1.1
defusedxml==0.7.1
dill==0.3.8
envisage==7.0.3
evaluate==0.4.3
exceptiongroup==1.2.0
executing==2.0.1
fastapi==0.115.8
fastjsonschema==2.19.0
ffmpy==0.5.0
filelock==3.17.0
fonttools==4.55.3
fqdn==1.5.1
frozenlist==1.5.0
fsspec==2024.9.0
gradio==5.15.0
gradio_client==1.7.0
h11==0.14.0
httpcore==1.0.7
httpx==0.28.1
huggingface-hub==0.28.1
idna==3.6
imageio==2.36.1
interchange==2021.0.4
ipykernel==6.27.1
ipython==8.19.0
ipywidgets==8.1.1
isoduration==20.11.0
jedi==0.19.1
jieba==0.42.1
Jinja2==3.1.2
joblib==1.4.2
json5==0.9.14
jsonpointer==2.4
jsonschema==4.20.0
jsonschema-specifications==2023.12.1
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.9.0
jupyter-lsp==2.2.1
jupyter_client==8.6.0
jupyter_core==5.5.1
jupyter_server==2.12.1
jupyter_server_terminals==0.5.0
jupyterlab==4.0.9
jupyterlab-widgets==3.0.9
jupyterlab_pygments==0.3.0
jupyterlab_server==2.25.2
kiwisolver==1.4.7
markdown-it-py==3.0.0
MarkupSafe==2.1.3
matplotlib==3.10.0
matplotlib-inline==0.1.6
mayavi==4.8.2
mdurl==0.1.2
mistune==3.0.2
monotonic==1.6
mpmath==1.3.0
msgpack==1.1.0
multidict==6.1.0
multiprocess==0.70.16
nbclient==0.9.0
nbconvert==7.13.1
nbformat==5.9.2
nest-asyncio==1.5.8
networkx==3.4.2
notebook==7.0.6
notebook_shim==0.2.3
numpy==2.2.0
orjson==3.10.15
overrides==7.4.0
packaging==23.2
pandas==2.2.3
pandocfilters==1.5.0
pansi==2020.7.3
parso==0.8.3
pillow==11.0.0
platformdirs==4.1.0
prometheus-client==0.19.0
prompt-toolkit==3.0.43
propcache==0.2.1
psutil==5.9.7
pure-eval==0.2.2
py2neo==2021.2.4
pyarrow==19.0.0
pycparser==2.21
pydantic==2.10.6
pydantic_core==2.27.2
pydub==0.25.1
pyface==8.0.0
Pygments==2.17.2
pyparsing==3.2.0
PyQt5==5.15.11
PyQt5-Qt5==5.15.2
PyQt5_sip==12.17.0
python-dateutil==2.8.2
python-json-logger==2.0.7
python-multipart==0.0.20
pytz==2024.1
pywin32==306
pywinpty==2.0.12
PyYAML==6.0.1
pyzmq==25.1.2
qtconsole==5.5.1
QtPy==2.4.1
referencing==0.32.0
regex==2024.11.6
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rich==13.9.4
rpds-py==0.15.2
ruff==0.9.6
safehttpx==0.1.6
safetensors==0.5.2
scikit-learn==1.6.1
scipy==1.15.1
seaborn==0.13.2
semantic-version==2.10.0
Send2Trash==1.8.2
shellingham==1.5.4
six==1.16.0
sniffio==1.3.0
soupsieve==2.5
stack-data==0.6.3
starlette==0.45.3
sympy==1.13.1
terminado==0.18.0
threadpoolctl==3.5.0
tinycss2==1.2.1
tokenizers==0.21.0
tomli==2.0.1
tomlkit==0.13.2
torch==2.6.0
torchvision==0.21.0
tornado==6.4
tqdm==4.67.1
traitlets==5.14.0
traits==7.0.2
traitsui==8.0.0
transformers==4.48.3
typer==0.15.1
types-python-dateutil==2.8.19.14
typing_extensions==4.12.2
tzdata==2025.1
uri-template==1.3.0
urllib3==2.1.0
uvicorn==0.34.0
wcwidth==0.2.12
webcolors==1.13
webencodings==0.5.1
websocket-client==1.7.0
websockets==14.2
widgetsnbextension==4.0.9
wordcloud==1.9.4
wslink==2.3.2
xxhash==3.5.0
yarl==1.18.3
2.pip uninstall -r requirements.txt -y
根据 requirements.txt 文件中的信息卸载所有库,其中,-r 选项用于指定从文件中读取要卸载的库列表,-y 选项表示自动确认卸载操作,无需手动逐个确认。