spyder doesn't launch after installing pytorch - python

I installed pytorch but after that Spyder can no longer be launched. Here are the terminal info:
conda install pytorch torchvision -c pytorch Solving environment: done
==> WARNING: A newer version of conda exists. <== current version: 4.5.10 latest version: 4.5.11
Please update conda by running
$ conda update -n base -c defaults conda
Package Plan
environment location: /anaconda3/envs/base_py36
added / updated specs:
- pytorch
- torchvision
The following packages will be downloaded:
package | build
---------------------------|-----------------
torchvision-0.2.1 | py36_1 123 KB pytorch
scipy-1.1.0 | py36hf1f7d93_0 15.4 MB
scikit-learn-0.20.0 | py36h4f467ca_1 5.4 MB
numpy-base-1.15.2 | py36h8a80b8c_1 4.1 MB
numpy-1.11.3 | py36heee0a97_5 3.4 MB
ninja-1.8.2 | py36h04f5b5a_1 93 KB
pytorch-0.4.1 |py36_cuda0.0_cudnn0.0_1 10.0 MB pytorch
------------------------------------------------------------
Total: 38.5 MB
The following NEW packages will be INSTALLED:
ninja: 1.8.2-py36h04f5b5a_1
pytorch: 0.4.1-py36_cuda0.0_cudnn0.0_1 pytorch
torchvision: 0.2.1-py36_1 pytorch
The following packages will be REMOVED:
accelerate: 2.3.1-np111py36_0
The following packages will be UPDATED:
mkl: 11.3.3-0 --> 2019.0-118
numexpr: 2.6.7-py36hde7755b_0 --> 2.6.8-py36h1dc9127_0
numpy: 1.11.3-py36_nomklh8ecaf62_5 --> 1.11.3-py36heee0a97_5
numpy-base: 1.15.0-py36he97cb71_0 --> 1.15.2-py36h8a80b8c_1
scikit-learn: 0.19.1-py36_nomklhde7755b_0 --> 0.20.0-py36h4f467ca_1
scipy: 1.1.0-py36_nomklh7cd7d8e_0 --> 1.1.0-py36hf1f7d93_0
The following packages will be DOWNGRADED:
blas: 1.0-openblas --> 1.0-mkl
Proceed ([y]/n)? y
Downloading and Extracting Packages torchvision-0.2.1 | 123 KB |
############################### | 100% scipy-1.1.0 | 15.4 MB | ##################################### | 100% scikit-learn-0.20.0 | 5.4 MB |
############################### | 100% numpy-base-1.15.2 | 4.1 MB | ##################################### | 100% numpy-1.11.3 | 3.4 MB | ##################################### | 100%
ninja-1.8.2 | 93 KB |
############################### | 100% pytorch-0.4.1 | 10.0 MB | ##################################### | 100% Preparing transaction: done

I don't know if you have solved your issue, but in case you have and someone else comes across this question or you haven't and are still waiting:
I came across your post as a result of having the same thing happen to me...
It would seem that all I had to do was "conda update all" for it to start working again!

I came across it too. And I tried reopen Anaconda Navigator and it worked....

Related

Unable to import Seaborn into IBM Watson using Python 3.7

I am getting a similar error while trying to import Seaborn into IBM Watson Studio for my Data Science Final Assignment. Could someone please help?
I checked Seaborn already exists in packages. However, when I try to install Conda using below command
!conda install -c anaconda seaborn -y
I get the following warnings/errors.
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: done
## Package Plan ##
environment location: /opt/conda/envs/Python-3.7-main
added / updated specs:
- seaborn
The following packages will be downloaded:
package | build
---------------------------|-----------------
entrypoints-0.3 | py37_0 12 KB anaconda
fontconfig-2.13.0 | h9420a91_0 291 KB anaconda
icu-58.2 | he6710b0_3 22.7 MB anaconda
jupyter_client-6.1.7 | py_0 76 KB anaconda
libpng-1.6.37 | hbc83047_0 364 KB anaconda
libuuid-1.0.3 | h1bed415_2 16 KB anaconda
libxcb-1.14 | h7b6447c_0 610 KB anaconda
libxml2-2.9.10 | hb55368b_3 1.3 MB anaconda
lz4-c-1.9.2 | heb0550a_3 203 KB anaconda
markupsafe-1.1.1 | py37h14c3975_1 26 KB anaconda
mistune-0.8.4 |py37h14c3975_1001 53 KB anaconda
ncurses-6.2 | he6710b0_1 1.1 MB anaconda
packaging-20.4 | py_0 35 KB anaconda
pandocfilters-1.4.2 | py37_1 13 KB anaconda
pyjwt-1.7.1 | py37_0 32 KB anaconda
webencodings-0.5.1 | py37_1 19 KB anaconda
------------------------------------------------------------
Total: 26.8 MB
The following NEW packages will be INSTALLED:
The following packages will be DOWNGRADED:
ibm-wsrt-py37main~ 0.0.0-2020 --> custom-2020
Downloading and Extracting Packages
icu-58.2 | 22.7 MB | ###################################9 | 97% WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(140): Could not remove or rename /opt/conda/pkgs/icu-58.2-he6710b0_3/share/icu/58.2/config/mh-linux. Please remove this file manually (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(140): Could not remove or rename /opt/conda/pkgs/icu-58.2-he6710b0_3/share/icu/58.2/install-sh. Please remove this file manually (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(140): Could not remove or rename /opt/conda/pkgs/icu-58.2-he6710b0_3/share/icu/58.2/LICENSE. Please remove this file manually (you may need to reboot to free file handles)
InvalidArchiveError('Error with archive /opt/conda/pkgs/jupyter_client-6.1.7-py_0.tar.bz2. You probably need to delete and re-download or re-create this file. Message from libarchive was:\n\nCould not unlink')}

Import problem for Facebook Prophet on AWS Sagemaker

I am trying to use Facebook Prophet on an AWS Sagemaker Jupyter notebook. I've tried installing fbprophet in two ways:
!{sys.executable} -m pip install fbprophet
and
!conda install -c conda-forge fbprophet --yes
(that last one comes from several answers I saw on other forums)
However, none of them seem to work. In particular, the latest one seems to work for the installation, but the subsequent import of fbprophet results in an error, that seems related to matplotlib:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-8-d9f3d4c04a60> in <module>()
1 # Imports
----> 2 from fbprophet import Prophet
~/anaconda3/envs/python3/lib/python3.6/site-packages/fbprophet/__init__.py in <module>()
6 # of patent rights can be found in the PATENTS file in the same directory.
7
----> 8 from fbprophet.forecaster import Prophet
9
10 __version__ = '0.6'
~/anaconda3/envs/python3/lib/python3.6/site-packages/fbprophet/forecaster.py in <module>()
17 from fbprophet.make_holidays import get_holiday_names, make_holidays_df
18 from fbprophet.models import StanBackendEnum
---> 19 from fbprophet.plot import (plot, plot_components)
20
21 logger = logging.getLogger('fbprophet')
~/anaconda3/envs/python3/lib/python3.6/site-packages/fbprophet/plot.py in <module>()
19
20 try:
---> 21 from matplotlib import pyplot as plt
22 from matplotlib.dates import (
23 MonthLocator,
~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/pyplot.py in <module>()
30 from cycler import cycler
31 import matplotlib
---> 32 import matplotlib.colorbar
33 import matplotlib.image
34 from matplotlib import rcsetup, style
~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/colorbar.py in <module>()
25
26 import matplotlib as mpl
---> 27 import matplotlib.artist as martist
28 import matplotlib.cbook as cbook
29 import matplotlib.collections as collections
~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/artist.py in <module>()
55
56
---> 57 class Artist(object):
58 """
59 Abstract base class for objects that render into a FigureCanvas.
~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/artist.py in Artist()
62 """
63 #cbook.deprecated("3.1")
---> 64 #property
65 def aname(self):
66 return 'Artist'
~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py in deprecate(obj, message, name, alternative, pending, addendum)
180 pass
181 """
--> 182
183 def deprecate(obj, message=message, name=name, alternative=alternative,
184 pending=pending, obj_type=obj_type, addendum=addendum):
AttributeError: 'property' object has no attribute '__name__'
Has anyone else run into this issue / managed to get fbprophet working on sagemaker? I'm thinking this might be an issue of versions of fbprophet and matplotlib, but couldn't find information on which ones to use.
The following works for me on a fresh notebook instance. I'm using the python3 environment.
sh-4.2$ source activate python3
(python3) sh-4.2$ conda install -c conda-forge fbprophet --yes
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.5.12
latest version: 4.8.2
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: /home/ec2-user/anaconda3/envs/python3
added / updated specs:
- fbprophet
The following packages will be downloaded:
package | build
---------------------------|-----------------
pykerberos-1.2.1 | py36h505690d_0 26 KB conda-forge
python-3.6.7 | h381d211_1004 34.5 MB conda-forge
cryptography-2.8 | py36h45558ae_2 628 KB conda-forge
python_abi-3.6 | 1_cp36m 4 KB conda-forge
binutils_impl_linux-64-2.33.1| h53a641e_8 9.1 MB conda-forge
certifi-2019.11.28 | py36h9f0ad1d_1 149 KB conda-forge
gcc_linux-64-7.3.0 | h553295d_17 21 KB conda-forge
gxx_linux-64-7.3.0 | h553295d_17 21 KB conda-forge
fbprophet-0.6 | py36he1b5a44_0 642 KB conda-forge
holidays-0.10.1 | py_0 56 KB conda-forge
tk-8.6.10 | hed695b0_0 3.2 MB conda-forge
lunarcalendar-0.0.9 | py_0 20 KB conda-forge
convertdate-2.1.3 | py_1000 30 KB conda-forge
curl-7.68.0 | hf8cf82a_0 137 KB conda-forge
krb5-1.16.4 | h2fd8d38_0 1.4 MB conda-forge
libcurl-7.68.0 | hda55be3_0 564 KB conda-forge
expat-2.2.9 | he1b5a44_2 191 KB conda-forge
binutils_linux-64-2.33.1 | h9595d00_17 21 KB conda-forge
python-dateutil-2.8.0 | py_0 219 KB conda-forge
matplotlib-base-3.1.0 | py36h5f35d83_0 6.7 MB conda-forge
pycurl-7.43.0.5 | py36h16ce93b_0 69 KB conda-forge
ld_impl_linux-64-2.33.1 | h53a641e_8 589 KB conda-forge
pystan-2.17.1.0 |py36hf2d7682_1004 14.0 MB conda-forge
ephem-3.7.7.1 | py36h516909a_0 722 KB conda-forge
------------------------------------------------------------
Total: 72.9 MB
The following NEW packages will be INSTALLED:
binutils_impl_linux-64: 2.33.1-h53a641e_8 conda-forge
binutils_linux-64: 2.33.1-h9595d00_17 conda-forge
convertdate: 2.1.3-py_1000 conda-forge
ephem: 3.7.7.1-py36h516909a_0 conda-forge
fbprophet: 0.6-py36he1b5a44_0 conda-forge
gcc_impl_linux-64: 7.3.0-habb00fd_1
gcc_linux-64: 7.3.0-h553295d_17 conda-forge
gettext: 0.19.8.1-hc5be6a0_1002 conda-forge
gxx_impl_linux-64: 7.3.0-hdf63c60_1
gxx_linux-64: 7.3.0-h553295d_17 conda-forge
holidays: 0.10.1-py_0 conda-forge
ld_impl_linux-64: 2.33.1-h53a641e_8 conda-forge
lunarcalendar: 0.0.9-py_0 conda-forge
matplotlib-base: 3.1.0-py36h5f35d83_0 conda-forge
pystan: 2.17.1.0-py36hf2d7682_1004 conda-forge
python_abi: 3.6-1_cp36m conda-forge
The following packages will be UPDATED:
ca-certificates: 2019.10.16-0 --> 2019.11.28-hecc5488_0 conda-forge
certifi: 2019.9.11-py36_0 --> 2019.11.28-py36h9f0ad1d_1 conda-forge
cryptography: 2.2.2-py36h14c3975_0 --> 2.8-py36h45558ae_2 conda-forge
curl: 7.60.0-h84994c4_0 --> 7.68.0-hf8cf82a_0 conda-forge
expat: 2.2.5-he0dffb1_0 --> 2.2.9-he1b5a44_2 conda-forge
glib: 2.56.1-h000015b_0 --> 2.58.3-h6f030ca_1002 conda-forge
krb5: 1.14.2-hcdc1b81_6 --> 1.16.4-h2fd8d38_0 conda-forge
libcurl: 7.60.0-h1ad7b7a_0 --> 7.68.0-hda55be3_0 conda-forge
libpng: 1.6.34-hb9fc6fc_0 --> 1.6.37-hed695b0_0 conda-forge
libssh2: 1.8.0-h9cfc8f7_4 --> 1.8.2-h22169c7_2 conda-forge
openssl: 1.0.2t-h7b6447c_1 --> 1.1.1d-h516909a_0 conda-forge
pycurl: 7.43.0.1-py36hb7f436b_0 --> 7.43.0.5-py36h16ce93b_0 conda-forge
pykerberos: 1.2.1-py36h14c3975_0 --> 1.2.1-py36h505690d_0 conda-forge
python: 3.6.5-hc3d631a_2 --> 3.6.7-h381d211_1004 conda-forge
python-dateutil: 2.7.3-py36_0 --> 2.8.0-py_0 conda-forge
qt: 5.9.6-h52aff34_0 --> 5.9.7-h5867ecd_1
sqlite: 3.23.1-he433501_0 --> 3.28.0-h8b20d00_0 conda-forge
tk: 8.6.7-hc745277_3 --> 8.6.10-hed695b0_0 conda-forge
Downloading and Extracting Packages
pykerberos-1.2.1 | 26 KB | ################################################################################ | 100%
python-3.6.7 | 34.5 MB | ################################################################################ | 100%
cryptography-2.8 | 628 KB | ################################################################################ | 100%
python_abi-3.6 | 4 KB | ################################################################################ | 100%
binutils_impl_linux- | 9.1 MB | ################################################################################ | 100%
certifi-2019.11.28 | 149 KB | ################################################################################ | 100%
gcc_linux-64-7.3.0 | 21 KB | ################################################################################ | 100%
gxx_linux-64-7.3.0 | 21 KB | ################################################################################ | 100%
fbprophet-0.6 | 642 KB | ################################################################################ | 100%
holidays-0.10.1 | 56 KB | ################################################################################ | 100%
tk-8.6.10 | 3.2 MB | ################################################################################ | 100%
lunarcalendar-0.0.9 | 20 KB | ################################################################################ | 100%
convertdate-2.1.3 | 30 KB | ################################################################################ | 100%
curl-7.68.0 | 137 KB | ################################################################################ | 100%
krb5-1.16.4 | 1.4 MB | ################################################################################ | 100%
libcurl-7.68.0 | 564 KB | ################################################################################ | 100%
expat-2.2.9 | 191 KB | ################################################################################ | 100%
binutils_linux-64-2. | 21 KB | ################################################################################ | 100%
python-dateutil-2.8. | 219 KB | ################################################################################ | 100%
matplotlib-base-3.1. | 6.7 MB | ################################################################################ | 100%
pycurl-7.43.0.5 | 69 KB | ################################################################################ | 100%
ld_impl_linux-64-2.3 | 589 KB | ################################################################################ | 100%
pystan-2.17.1.0 | 14.0 MB | ################################################################################ | 100%
ephem-3.7.7.1 | 722 KB | ################################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(python3) sh-4.2$
(python3) sh-4.2$
(python3) sh-4.2$
(python3) sh-4.2$ python
Python 3.6.7 | packaged by conda-forge | (default, Feb 28 2019, 09:07:38)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fbprophet
>>>

Installing Python package will download, install, and remove other packages

I want to install cvxopt in Anaconda Python. Here's the version of my software:
$ python --version
Python 3.6.5 :: Anaconda, Inc.
$ conda --version
conda 4.5.11
$ anaconda --version
anaconda Command line client (version 1.6.14)
I try to install by typing:
conda install cvxopt
I was prompted that about 40 packages will be downloaded, about 10 NEW packages will be installed, the package anaconda will be removed, and about 25 packages will be updated?
Are the NEW packages dependencies?
Why will conda remove the anaconda package? Isn't conda a part of anaconda?
Here is the full output:
Solving environment: done
## Package Plan ##
environment location: /usr/local/anaconda3
added / updated specs:
- cvxopt
The following packages will be downloaded:
package | build
---------------------------|-----------------
suitesparse-5.2.0 | h171a5a3_0 2.4 MB
openssl-1.1.1a | h7b6447c_0 5.0 MB
freetype-2.9.1 | h8a8886c_1 822 KB
harfbuzz-1.8.8 | hffaf4a1_0 863 KB
libssh2-1.8.0 | h1ba5d50_4 233 KB
cairo-1.14.12 | h8948797_3 1.3 MB
libstdcxx-ng-8.2.0 | hdf63c60_1 2.9 MB
conda-4.6.1 | py36_0 1.7 MB
glpk-4.65 | h3ceedfd_2 1.1 MB
expat-2.2.6 | he6710b0_0 187 KB
krb5-1.16.1 | h173b8e3_7 1.4 MB
tbb-2018.0.5 | h6bb024c_0 1.4 MB
sqlite-3.26.0 | h7b6447c_0 1.9 MB
cvxopt-1.2.0 | py36h9e0dedd_0 537 KB
glib-2.56.2 | hd408876_0 5.0 MB
python-3.6.8 | h0371630_0 34.4 MB
certifi-2018.11.29 | py36_0 146 KB
gsl-2.4 | h14c3975_4 2.6 MB
cryptography-2.4.2 | py36h1ba5d50_0 618 KB
libuuid-1.0.3 | h1bed415_2 16 KB
curl-7.63.0 | hbc83047_1000 145 KB
libgcc-ng-8.2.0 | hdf63c60_1 7.6 MB
fribidi-1.0.5 | h7b6447c_0 112 KB
ca-certificates-2018.12.5 | 0 123 KB
pango-1.42.3 | h8589676_0 522 KB
libpng-1.6.36 | hbc83047_0 346 KB
pycurl-7.43.0.2 | py36h1ba5d50_0 185 KB
tk-8.6.8 | hbc83047_0 3.1 MB
qt-5.9.7 | h5867ecd_1 85.9 MB
mkl-2018.0.3 | 1 198.7 MB
libcurl-7.63.0 | h20c2e04_1000 550 KB
metis-5.1.0 | hf484d3e_4 4.1 MB
fontconfig-2.13.0 | h9420a91_0 291 KB
matplotlib-3.0.2 | py36h5429711_0 6.5 MB
pillow-5.4.1 | py36h34e0f95_0 627 KB
------------------------------------------------------------
Total: 373.2 MB
The following NEW packages will be INSTALLED:
cvxopt: 1.2.0-py36h9e0dedd_0
fribidi: 1.0.5-h7b6447c_0
glpk: 4.65-h3ceedfd_2
gsl: 2.4-h14c3975_4
krb5: 1.16.1-h173b8e3_7
libuuid: 1.0.3-h1bed415_2
metis: 5.1.0-hf484d3e_4
suitesparse: 5.2.0-h171a5a3_0
tbb: 2018.0.5-h6bb024c_0
The following packages will be REMOVED:
anaconda: 5.2.0-py36_3
The following packages will be UPDATED:
ca-certificates: 2018.03.07-0 --> 2018.12.5-0
cairo: 1.14.12-h7636065_2 --> 1.14.12-h8948797_3
certifi: 2018.4.16-py36_0 --> 2018.11.29-py36_0
conda: 4.5.11-py36_0 --> 4.6.1-py36_0
cryptography: 2.2.2-py36h14c3975_0 --> 2.4.2-py36h1ba5d50_0
curl: 7.60.0-h84994c4_0 --> 7.63.0-hbc83047_1000
expat: 2.2.5-he0dffb1_0 --> 2.2.6-he6710b0_0
fontconfig: 2.12.6-h49f89f6_0 --> 2.13.0-h9420a91_0
freetype: 2.8-hab7d2ae_1 --> 2.9.1-h8a8886c_1
glib: 2.56.1-h000015b_0 --> 2.56.2-hd408876_0
harfbuzz: 1.7.6-h5f0a787_1 --> 1.8.8-hffaf4a1_0
libcurl: 7.60.0-h1ad7b7a_0 --> 7.63.0-h20c2e04_1000
libgcc-ng: 7.2.0-hdf63c60_3 --> 8.2.0-hdf63c60_1
libpng: 1.6.34-hb9fc6fc_0 --> 1.6.36-hbc83047_0
libssh2: 1.8.0-h9cfc8f7_4 --> 1.8.0-h1ba5d50_4
libstdcxx-ng: 7.2.0-hdf63c60_3 --> 8.2.0-hdf63c60_1
matplotlib: 2.2.2-py36h0e671d2_1 --> 3.0.2-py36h5429711_0
mkl: 2018.0.2-1 --> 2018.0.3-1
openssl: 1.0.2o-h20670df_0 --> 1.1.1a-h7b6447c_0
pango: 1.41.0-hd475d92_0 --> 1.42.3-h8589676_0
pillow: 5.1.0-py36h3deb7b8_0 --> 5.4.1-py36h34e0f95_0
pycurl: 7.43.0.1-py36hb7f436b_0 --> 7.43.0.2-py36h1ba5d50_0
python: 3.6.5-hc3d631a_2 --> 3.6.8-h0371630_0
qt: 5.9.5-h7e424d6_0 --> 5.9.7-h5867ecd_1
sqlite: 3.23.1-he433501_0 --> 3.26.0-h7b6447c_0
tk: 8.6.7-hc745277_3 --> 8.6.8-hbc83047_0
Proceed ([y]/n)? n
CondaSystemExit: Exiting.
The anaconda package is called a "meta-package" because it does not contain any code itself, but instead specifies dependencies of other packages that should be installed. The package cvoptx is not one of the packages specified by the anaconda package, so if you try to install cvoptx, there is a conflict that conda resolves by removing the anaconda package (since you give cvoptx higher priority by specifying as required to be installed in the environment).
conda and anaconda are separate, and have separate versions. conda is the command line interface that allows you to install, update, and remove packages and environments. anaconda is described above.
Finally (and confusingly), the anaconda command on the command line is provided by the anaconda-client package, not the anaconda package. If you want to see the version of Anaconda that is installed, use conda list anaconda. If you want the version of the anaconda-client command line tool, use anaconda --version. The anaconda-client is used to upload packages and environments to https://anaconda.org
The best way is to install it in a separate environment. It is recommended to have different environments for each project. I tend to avoid mixing project requirements together. For the project using cvxopt, I would do:
conda create --name cvx python=3.6
So here I create an environment called cvx that has Python 3.6
This will download all needed packages for Python36. Since it is a clean environment, there would be no upgrading or downgrading.
After that you can activate your environment as:
conda activate cvx
conda install -c conda-forge cvxopt
In these environment you have cvxopt. You can the build your project and run it in these environment. If you need extra packages, you can do:
conda install -n cvxopt PACKAGESNAME
Here is everything you need to know to work with environments https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

ipcluster3.exe failed to create process

I am trying to run ipcluster3.exe on an Anaconda python 3.3 installation on Windows 7 64-bit.
However, when I run it I get an error:
C:\Anaconda\envs\py33\Scripts>ipcluster3.exe
failed to create process.
C:\Anaconda\envs\py33\Scripts>ipcluster3.exe start -n 4
failed to create process.
The error doesn't really give me enough to start debugging.
It looks like my copy of Anacondas came with a Beta version of IPython.
I updated it using Conda.
conda update -n py33 ipython
The following packages will be downloaded:
package | build
---------------------------|-----------------
ipython-2.3.1 | py33_0 3.0 MB
pyreadline-2.0 | py33_0 135 KB
------------------------------------------------------------
Total: 3.1 MB
The following packages will be UN-linked:
package | build
---------------------------|-----------------
ipython-0.13.2 | py33_0
pyreadline-2.0.dev | py33_0
The following packages will be linked:
package | build
---------------------------|-----------------
ipython-2.3.1 | py33_0 hard-link
pyreadline-2.0 | py33_0 hard-link

Anaconda/MacOS: Change default python version

I was using python with anaconda on osx 10.8 when spyder crashed. When I tried to restart it, the launcher showed it as uninstalled. I figured there might be something wrong with anaconda, so I restarted my computer, but the problem persisted.
Looking into it, I noticed the default version of python had been changed:
$ python --version
Python 3.4.1 :: Continuum Analytics, Inc.
I tried changing it back by using Apple's defaults write, relinking python with ln -sf, simply setting an alias python=python2.7, to no effect.
Then I tried removing python3 with conda, but conda remove python3 won't do the trick. Searching for packages produces this:
$ conda search python
Fetching package metadata: ..
(...)
python 1.0.1 0 defaults
(...)
. 2.7.5 2 defaults
. 2.7.5 3 defaults
(...)
* 3.4.1 0 defaults
I also looked up Continuum docs, and they recommend leaving 2.7 as standard and using an Anaconda environment if I want to use a different version, which doesn't help me.
Does anybody have any idea of how to change default version back to 2.7?
(Specs are: anaconda 1.7.0, osx 10.8.5, conda 3.5.2)
Alright, I found a similar problem in the Continuum mailing list.
This was solved by re-installing python through conda
$ conda install python=2.7
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment /Users/kadu/anaconda:
The following packages will be downloaded:
package | build
---------------------------|-----------------
conda-3.5.2 | py27_0 135 KB
pycosat-0.6.1 | py27_0 57 KB
python-2.7.6 | 2 16.5 MB
pyyaml-3.11 | py27_0 149 KB
requests-2.3.0 | py27_0 564 KB
------------------------------------------------------------
Total: 17.4 MB
The following packages will be UN-linked:
package | build
---------------------------|-----------------
conda-3.5.2 | py34_0
pycosat-0.6.1 | py34_0
python-3.4.1 | 0
pyyaml-3.11 | py34_0
requests-2.3.0 | py34_0
The following packages will be linked:
package | build
---------------------------|-----------------
conda-3.5.2 | py27_0 hard-link
pycosat-0.6.1 | py27_0 hard-link
python-2.7.6 | 2 hard-link
pyyaml-3.11 | py27_0 hard-link
requests-2.3.0 | py27_0 hard-link
Proceed ([y]/n)?
This can also be used to change which is the default package under anaconda environments:
$ conda install python=3.4
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment /Users/kadu/anaconda:
The following packages will be UN-linked:
package | build
---------------------------|-----------------
conda-3.5.2 | py27_0
pycosat-0.6.1 | py27_0
python-2.7.6 | 2
pyyaml-3.11 | py27_0
requests-2.3.0 | py27_0
The following packages will be linked:
package | build
---------------------------|-----------------
conda-3.5.2 | py34_0 hard-link
pycosat-0.6.1 | py34_0 hard-link
python-3.4.1 | 0 hard-link
pyyaml-3.11 | py34_0 hard-link
requests-2.3.0 | py34_0 hard-link
Proceed ([y]/n)?
However, this would require manually changing the builds to any other packages you use. I had to reinstall spyder, which seems to have caused the bug in the first place and was presumably reinstalled when I tried to launch it under the wrong version. All the other libraries, which I didn't try to reinstall, are still working fine under 2.7.

Categories