spyder安装+使用中的问题

如该有其他的什么问题欢迎大家留言!

一、spyder的安装指令

方法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*

二、spyder使用过程中遇到的问题

1、问题描述:

Traceback (most recent call last):

  File "<ipython-input-3-bc7ab1fdfb9b>", line 1, in <module>
    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 <module>
    import torch

  File "/usr/local/lib/python3.6/site-packages/torch/__init__.py", line 184, in <module>
    from .tensor import Tensor

  File "/usr/local/lib/python3.6/site-packages/torch/tensor.py", line 12, in <module>
    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就可以了(不重启还是不能使用的哟!)

2、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

 

  • 3
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 19
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 19
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值