如该有其他的什么问题欢迎大家留言!
方法1、在安装之前,最好安装以下python常用库和依赖:
sudo apt-get install python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev
sudo pip install scrapy
sudo apt-get install libzmq-dev
sudo pip install pyzmq #here
sudo pip install pygments
sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer
sudo pip install qtconsole
sudo pip install ipython
然后安装:
sudo apt install spyder #安装spyder2
sudo apt install spyder3 #安装spyder3
spyder的卸载:
sudo apt-get remove spyder
运行时报错,
sudo apt-get install python3-pyqt*
方法2:
sudo apt-get install python3-pyqt5 python-sphinx
sudo apt-get install python3-pyqt*
sudo pip3 install spyder #安装spyder3
方法3:
sudo pip3 install -U spyder
然后会出错:psutil/_psutil_linux.c:12:20: fatal error: Python.h: 没有那个文件或目录
解决办法:
sudo apt-get install python3-dev
接着在重复指令:sudo pip3 install -U spyder
最后:sudo apt-get install python3-pyqt*
Traceback (most recent call last):
File "", line 1, in
runfile('/Users/aaa/.spyder-py3/temp.py', wdir='/Users/aaa/.spyder-py3')
File "/usr/local/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile
execfile(filename, namespace)
File "/usr/local/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/Users/aaa/.spyder-py3/temp.py", line 7, in
import torch
File "/usr/local/lib/python3.6/site-packages/torch/__init__.py", line 184, in
from .tensor import Tensor
File "/usr/local/lib/python3.6/site-packages/torch/tensor.py", line 12, in
class Tensor(torch._C._TensorBase):
File "/usr/local/lib/python3.6/site-packages/torch/tensor.py", line 170, in Tensor
""")
RuntimeError: method 'detach' already has a docstring
解决方法:
tools -->preferences-->python interpreter -->set UMR excluded (not reloaded) modules
(在其中添加reloaded moudle中的文件)
然后重启spyder就可以了(不重启还是不能使用的哟!)
报如下错误:
Spyder crashed during last session.
If Spyder does not start at all and before submitting a bug report,
please try to reset settings to defaults by running Spyder with the command line option
'--reset': spyder --reset
Warning: this command will remove all your Spyder configuration files located in
'/Users/repair/.spyder-py3').
If restoring the default settings does not help, please take the time to search for
known bugs or discussions matching your situation before eventually creating a new
issue here. Your feedback will always be greatly appreciated.
解决方法:
pip3 install --upgrade pip
sudo pip3 install --upgrade setuptools