当前位置:   article > 正文

spyder安装+使用中的问题_runtimeerror: method 'detach' already has a docstr

runtimeerror: method 'detach' already has a docstring ]

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

一、spyder的安装指令

方法1、在安装之前,最好安装以下python常用库和依赖:

  1. sudo apt-get install python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev
  2. sudo pip install scrapy
  3. sudo apt-get install libzmq-dev
  4. sudo pip install pyzmq #here
  5. sudo pip install pygments
  6. sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer
  7. sudo pip install qtconsole
  8. sudo pip install ipython

然后安装:

  1. sudo apt install spyder #安装spyder2
  2. sudo apt install spyder3 #安装spyder3

spyder的卸载:

sudo apt-get remove spyder

运行时报错,

sudo apt-get install python3-pyqt*

方法2:

  1. sudo apt-get install python3-pyqt5 python-sphinx
  2. sudo apt-get install python3-pyqt*
  3. 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、问题描述:

  1. Traceback (most recent call last):
  2. File "<ipython-input-3-bc7ab1fdfb9b>", line 1, in <module>
  3. runfile('/Users/aaa/.spyder-py3/temp.py', wdir='/Users/aaa/.spyder-py3')
  4. File "/usr/local/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile
  5. execfile(filename, namespace)
  6. File "/usr/local/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
  7. exec(compile(f.read(), filename, 'exec'), namespace)
  8. File "/Users/aaa/.spyder-py3/temp.py", line 7, in <module>
  9. import torch
  10. File "/usr/local/lib/python3.6/site-packages/torch/__init__.py", line 184, in <module>
  11. from .tensor import Tensor
  12. File "/usr/local/lib/python3.6/site-packages/torch/tensor.py", line 12, in <module>
  13. class Tensor(torch._C._TensorBase):
  14. File "/usr/local/lib/python3.6/site-packages/torch/tensor.py", line 170, in Tensor
  15. """)
  16. RuntimeError: method 'detach' already has a docstring

解决方法:

  1. tools -->preferences-->python interpreter -->set UMR excluded (not reloaded) modules
  2. (在其中添加reloaded moudle中的文件)

然后重启spyder就可以了(不重启还是不能使用的哟!)

2、spyder不能启动

报如下错误:

  1. Spyder crashed during last session.
  2. If Spyder does not start at all and before submitting a bug report,
  3. please try to reset settings to defaults by running Spyder with the command line option
  4. '--reset': spyder --reset
  5. Warning: this command will remove all your Spyder configuration files located in
  6. '/Users/repair/.spyder-py3').
  7. If restoring the default settings does not help, please take the time to search for
  8. known bugs or discussions matching your situation before eventually creating a new
  9. issue here. Your feedback will always be greatly appreciated.

解决方法:

  1. pip3 install --upgrade pip
  2. sudo pip3 install --upgrade setuptools

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/342058
推荐阅读
相关标签
  

闽ICP备14008679号