Reputation: 1
Hi I am pretty new to python. I am coding with spyder using the Navigator(anaconda launcher). I have created a new virtual environment named 'john' and installed some packages on it using the following commands in terminal:
conda create -n john python=2.7 anaconda
source activate john
conda install -n john -c akode lasagne=0.1dev
conda install -n john -c derickl nolearn=0.5b1
then I tried to open spyder and run the code by typing ‘spyder’ in terminal and this is the error I get:
Traceback (most recent call last):
File "/Users/Hengameh/anaconda2/envs/john/bin/spyder", line 3, in <module>
start_app.main()
File "/Users/Hengameh/anaconda2/envs/john/lib/python2.7/site- packages/spyderlib/start_app.py", line 114, in main
from spyderlib import spyder
File "/Users/Hengameh/anaconda2/envs/john/lib/python2.7/site- packages/spyderlib/spyder.py", line 88, in <module>
from spyderlib.qt.QtGui import (QApplication, QMainWindow, QSplashScreen,
File "/Users/Hengameh/anaconda2/envs/john/lib/python2.7/site- packages/spyderlib/qt/QtGui.py", line 10, in <module>
from PyQt4.Qt import QKeySequence, QTextCursor # analysis:ignore
ImportError: cannot import name QKeySequence
and also when I try to open the Navigator launcher associated with the john environment it crashes and doesn’t open.
Now the interesting part is that the Navigator launcher associated with the default root environment opens without any problem and so does the spyder in the root env.
Any ideas of how to make it work or why is it doing this? id really appreciate your help :))
Upvotes: 0
Views: 2317
Reputation: 31
I had recently a similar issue (Although I was upgrading to v 3.5 but the process should be the same), so I went first to update my 'conda' before defining the virtual environment and launching 'Spyder'. More precisely :
conda update conda
conda create -n john27 python=2.7 anaconda
activate john27
conda install PackageName
(you don't need to specify again the name of the environement as it is already active) if the package is from the Anaconda repository, otherwise use pip install PackageName
(NB: you don't need to activate'virtualenv' in this case as conda environment looks already after this)spyder
And things should be working fine -I hope this helps!
Upvotes: 3