Spyder will not launch on Ubuntu 16.10 - python-2.7

I have installed python 2.7, 3.5, Anaconda2 and Anaconda3. I cannot get spyder v3.01, 3.00, 2.3.9, or 2.3.8 to launch in any of these environments. From the command line, typing spyder or even python spyder --reset result in
Segmentation fault (core dumped)
Has anyone else experienced this? Is there a fix?

Okay I finally figured out the problem, which likely only affects those who have first tried to install things like spyder in their default python distribution (even if this was later "removed"). The solution was first to start a python shell and check sys.path:
>>> import sys
>>> sys.path
Make sure all the listed paths are within your current python environment. For me, all paths included my anaconda installation path except one, which started with /home/jack/.local. Not sure how that got in there. Removing this from the path (using sys.path.pop() or sys.path.remove() in python fixed the problem.
To permanently fix the problem, I simply removed the "leftovers" from previously installed python packages that were hanging around in my .local directory. Now everything is great.
Thanks to Carlos Cordoba for the hints, and (more importantly) for spyder!
Cheers!

Related

Python broke when installing 3.x

I had my mac osx working fine with python 2.7.10, and I've installed python3 via brew install python3.
on my bash_profile I then create an alias python=python3.
but when I
>>python3
I got:
Your PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x!
PYTHONPATH is currently: "/usr/local/lib/python2.7/site-packages:"
You should unset PYTHONPATH to fix this.
then I ran brew uninstall python3, but things did not come to previous configuration, and I couldn't run neither python versions anymore.
>>python now gives me:
-bash: python3: command not found
I tried then to brew link python3, since it appeared to be there, but to no avail.
now, If I which python, I get:
/usr/local/bin/python.
how do I fix this mess, minding that I want to keep both 2.7 and 3.5?
ps. my bash_profile now:
export PATH=“/usr/local/bin:/usr/local/sbin:/usr/bin:~/bin:./bin:$PATH"
"export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"
Attempt to set the PYTHONPATH environment variable manually to point to the correct python installation. If you want both, set it to both (separated with a ; semicolon) and just specify in the cmd python2 or python3 depending on which you want to open.
This explains how to access the enviorment variables on OSX:
Setting environment variables in OS X?
Sorry, I'd provide more detail but I only run Linux and Windows on my home machines so I don't know much about OSX.
edit: actually, you may need to seperate different locations with a , comma rather then semicolon. Don't know, look at the existing ones to see how it is.

spyder, numpy, anaconda : cannot import name multiarray

I am on Windows 10, 64bits, use Anaconda 4 and I created an environment with python 2.7 (C:/Anaconda3/envs/python2/python.exe)
In this environment, I successfully installed numpy and when I type "python", enter, "import numpy", enter, it works perfectly in the anaconda prompt window.
In spyder however, when I open a python console and type "import numpy", I get "cannot import name multiarray". I have obviously changed the path of the python interpreter used by spyder to match the python.exe of the environment I created (C:/Anaconda3/envs/python2/python.exe). I also updated the PYTHONSTARTUP to C:/Anaconda3/envs/python2/Lib/site-packages/spyderlib/scientific_startup.py
It's supposed to be the exact same python program running but it's two different behavior. How is it possible and how to fix it ?
PS: I already tried the various solutions to this error like uninstalling numpy and reinstalling it. It shouldn't be a problem with numpy since it works just fine in the python console of the anaconda prompt window.
I solved the problem by executing the spyder version of the python2 environment.
It is located in Anaconda3\envs\python2\Scripts\spyder.exe
I have encountered same issue. I have followed every possible solution, which is stated on stack-overflow. But no luck. The cause of error might be the python console. I have installed a 3.5 Anaconda, and the default console is the python 2.7, which I have installed primarily with pydev. I did this and now it is working absolutely fine. Go to tools>preferences and click on reset to defaults. It might solve the issue. Or another solution is to uninstall the current Anaconda i.e. y.x and installing the correct one according to the default. In my case 2.7 Anaconda instead of 3.5

Spyder in WinPython can't connect to kernel

I am using a fresh install of WinPython 2.7, which includes Spyder 3.0.0, on Windows 10. When I start Spyder, the ipython console never connects to the kernel.
I have tried resetting spyder through the WinPython command prompt (spyder --reset&&spyder) and regular command line (spyder --reset) and tried opening multiple ipython consoles without any luck. There are no errors in the kernel tab. I have made sure that Spyder is pointing to the correct python.exe in WinPython. I have made sure the qtconsole is installed. Ipython QT console built into WinPython works fine.
Thank you for any help you can provide.
what is your path to winpython ? spaces or unicode characters may trouble Spyder.
Otherwise try with a previous, or posterior version of WinPython

too many pythons on linux

i recently started using python with xubuntu on virtualbox but i'm having problems. I want to be able to use numpy so i thought that apt-get install python-numpy would solve everything, but using the shell i kept getting No module named numpy. I used IDLE and it could find it. I also have IDLE (using Python-2.7), and again it could import numpy. Then i noticed that the shell had python 2.7.9, while the IDLEs had python 2.7.6.
Using
import sys
print sys.path
this if what i get from 2.7.9 (shell)
/usr/local/lib/python2.7/site-packages/setuptools-17.0-py2.7.egg
/usr/local/lib/python2.7/site-packages/Pillow-2.3.0-py2.7-linux-x86_64.egg
/usr/local/lib/python2.7/site-packages/mock-1.0.1-py2.7.egg
/usr/local/lib/python27.zip
/usr/local/lib/python2.7
/usr/local/lib/python2.7/plat-linux2
/usr/local/lib/python2.7/lib-tk
/usr/local/lib/python2.7/lib-old
/usr/local/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/site-packages
and from 2.7.6 (IDLE)
/home/alessandro
/usr/bin
/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/PILcompat
/usr/lib/python2.7/dist-packages/gtk-2.0
/usr/lib/pymodules/python2.7
/usr/lib/python2.7/dist-packages/ubuntu-sso-client
I understand that i have two versions of python installed and somehow i ended up installing packageg into only one of them (the 2.7.6).
I'd like to be able to use 2.7.9 both in the shell and in IDLE and also i'd like to install so that python 2.7.9 can see them.
I read that i can add paths to the python sys.path, but isn't there a more efficient/persistent way to do what i want?
PS: tell me if you need more informations
For my projects I usually create a virtualenv for each python version I need for the project at hand. I manage them using pip to install specific versions that I need. Moreover you should be able to choose the python path in your IDE. While I'm not using IDLE, I read here that apparently idle comes along with the python versions during install. So maybe your idle versions collide with each other. If you want to have only one python version at the time on your machine you might consider a simple remove and fresh install of your desired version. Again I would recommend pip over apt-get etc. Hope this is of help for you.
Worth to check PyDev, a plugin for Eclipse to work on python.
http://marketplace.eclipse.org/content/pydev-python-ide-eclipse , or http://pydev.org/.
This allows you to configure the python version for different project's.
I have some project's with python 2.7 and others with 3.4.
it's checks the whole system in search for the PYTHONPATH to use!

Installing anaconda to use with windows

I am lost in the installation process of installing anaconda on windows.
I've installed the windows 32bit package (I'm running windows 7 x64)
I have anaconda in the start menu and I can open the python console and use scipy.stats.t.interval(), the function I am interested in.
However, how do I go about including this in another python program? I think it's something like adding it to the path. For instance, I have the scipy.stats.t.interval() function call in my other python file which I run through cygwin via python myscript.py. However it returns the error:
from scipy.stats import t
ImportError: No module named scipy.stats
I think it might be a change of path / add to path issue, but I'm not sure how to fix it :/. While I try to fix it, I figure I will post for help here.
well you might have two installations of python, one inside the anaconda package, and other which you might have installed earlier. try doing :
which python
from CygWin console.
If it returns:
/usr/bin
then it is definitely a add-to-path problem.
to fix it for CygWin,
you have to add the python installation from anaconda to the path.
try this fromn CygWin:
PATH=path-where-anaconda-is-installed/anaconda/bin:$PATH
and then doing:
which python
should give you:
/path-to-anaconda/anaconda/bin
and then it will work.
Cheers