简体   繁体   English

找不到Spyder pip安装:OSX

[英]Spyder pip install not found: OSX

So I have installed spyder through the pip install spyder command on my terminal. 所以我已经通过终端上的pip install spyder命令pip install spyder When I type pip show spyder I receive: 当我输入pip show spyder我收到:

Name: spyder
Version: 3.1.3
Summary: Scientific PYthon Development EnviRonment
Home-page: https://github.com/spyder-ide/spyder
Author: The Spyder Project Contributors
Author-email: UNKNOWN
License: MIT
Location: /Users/g******/anaconda/lib/python3.5/site-packages
Requires: pyzmq, chardet, nbconvert, numpydoc, qtconsole, qtpy, jedi, pickleshare, pep8, pyflakes, pygments, rope-py3k, sphinx, qtawesome, psutil, pylint

Also, when I launch anaconda platform and go to the environments>root I see that spyder is there. 另外,当我启动anaconda平台并转到环境> root时,我看到那里是spyder。 But, in the Home section it shows that is not installed. 但是,在“主页”部分中,它表明未安装。 Furthermore, on terminal, when I type python it runs smoothly, when I do the same for jupyter notebook again it runs smoothly. 此外,在终端上,当我键入python时,它运行平稳;当我再次对jupyter notebook进行相同操作时,它也运行平稳。 But, when I type spyder I get: 但是,当我输入spyder时,我得到:

G****-MacBook-Pro:~ g*****$ spyder
-bash: /Users/g*****/anaconda/bin/spyder: No such file or directory

I think it has to do with the directory the programmes are installed. 我认为这与程序安装目录有关。 Nevertheless, it seems weird to a newbie like myself. 然而,对于像我这样的新手来说似乎很奇怪。 Any suggestions how to launch spyder? 有什么建议如何发射间谍吗?

UPDATE: Ok so when I execute which python on terminal, I get the location: 更新:好的,所以当我在终端上执行哪个python时,我得到了以下位置:

/Users/g*****/anaconda/bin/python

Now, I am 100% sure that it has to do with the locality of the programme. 现在,我100%确信它与计划的所在地有关。 Eventhough, still seems weird to me that I can see the package on the root environment of Anaconda but I am not able to launch it. 即使如此,我仍然觉得很奇怪,因为我可以在Anaconda的根环境中看到该程序包,但无法启动它。

It seems like bash can find the program in $PATH because it's adding the full path ( /Users/.../bin/spyder ), but you could verify this with which : 好像bash可以在$PATH找到该程序,因为它添加了完整路径( /Users/.../bin/spyder ),但是您可以通过以下方式验证此which

$ which spyder
/Users/.../bin/spyder

After that, there might be a problem with that executable, probably in the shebang, the first line that starts with #! 之后,该可执行文件可能会出现问题,可能在shebang中以#!开头的第一行#! that instructs bash on how to run the program. 指示bash如何运行该程序。

$ head `which spyder`
#! (there should be a valid path to Python here...)
import blah
...

That path is probably broken, so you'll need to figure out why and fix your environment. 该路径可能已损坏,因此您需要找出原因并修复环境。 If you moved the path it's referring to around or deleted it, that's why. 如果您移动了它所指的路径或将其删除,这就是原因。 Other than hand-fixing the path, you might be able to uninstall the package and reinstall it; 除了手动修复路径外,您还可以卸载软件包并重新安装; Python will correctly set the shebang on installation. Python将在安装时正确设置shebang。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM