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.
Related
I have a conda environment running Python 3.7.5. I tried updating it to the latest version (3.8.0) but it wants to update other packages (even downgrade scipy), and says nothing about upgrading Python.
Why is this happening?
(workenv) $ conda update python
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /home/gabriel/miniconda3/envs/workenv
added / updated specs:
- python
The following packages will be downloaded:
package | build
---------------------------|-----------------
blas-1.0 | openblas 46 KB
certifi-2019.9.11 | py37_0 154 KB
libopenblas-0.3.6 | h5a2b251_2 7.7 MB
numpy-1.17.4 | py37hd5be1e1_0 4 KB
numpy-base-1.17.4 | py37h2f8d375_0 4.1 MB
scipy-1.3.1 | py37he2b7bc3_0 14.0 MB
------------------------------------------------------------
Total: 26.0 MB
The following NEW packages will be INSTALLED:
libopenblas pkgs/main/linux-64::libopenblas-0.3.6-h5a2b251_2
The following packages will be REMOVED:
intel-openmp-2019.4-243
mkl-2019.4-243
mkl-service-2.3.0-py37he904b0f_0
mkl_fft-1.0.15-py37ha843d7b_0
mkl_random-1.1.0-py37hd6b4f25_0
The following packages will be UPDATED:
blas 1.0-mkl --> 1.0-openblas
ca-certificates conda-forge::ca-certificates-2019.9.1~ --> pkgs/main::ca-certificates-2019.10.16-0
numpy 1.17.3-py37hd14ec0e_0 --> 1.17.4-py37hd5be1e1_0
numpy-base 1.17.3-py37hde5b4d6_0 --> 1.17.4-py37h2f8d375_0
openssl conda-forge::openssl-1.1.1d-h516909a_0 --> pkgs/main::openssl-1.1.1d-h7b6447c_3
The following packages will be SUPERSEDED by a higher-priority channel:
certifi conda-forge --> pkgs/main
The following packages will be DOWNGRADED:
scipy 1.3.1-py37h7c811a0_0 --> 1.3.1-py37he2b7bc3_0
Proceed ([y]/n)?
It's might check and install the dependencies of python before installing the python update itself. (You could check it by comparing the dependencies list of the different python versions.)
If the newest version of python is incompatible with the newest version of scipy, it will install an older version of scipy to make sure it will run stable.
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
I have py2.7 as my original Anaconda install, and have installed py3.4 in an environment named py3.
I cannot seem to be able to install blpapi, the Bloomberg API library, in the py3 environment.
Once I activate py3, conda install blpapi cannot find the package, whereas pip install blpapi tells me that:
Requirement already satisfied: blpapi in C:\users\pythonic\programs\anaconda\lib\site-packages
Because it finds the package installed for python 2.7
If I try to install via the executable from here it tells me that it cannot find python 3.4 in the registry.
How do I install this package?
Edit
Apparently the DSM channel does not have the py3.5 version anymore but this channel does
https://anaconda.org/macinv/blpapi/files
One solution would be creating a Python 3.5 environment:
conda create -n py35 python=3.5
activating it:
activate py35
and installing blpapi form the channel dsm:
conda install -c dsm blpapi
The channel dsm is an Anaconda channel. It provides these files:
win-64/blpapi-3.9.0-py35_0.tar.bz2
win-64/blpapi-3.5.5-py27_0.tar.bz2
linux-64/blpapi-3.5.5-py27_0.tar.bz2
This means blpapi is available for Windows for Python 2.7 and 3.5 but not for 3.4.
To find a package, enter the package name in the Anaconda search window (top of page).
In addition to Mike Müller's answer above, I thought I would add a section on the anaconda search utility for finding packages hosted on https://anaconda.org/.
$ anaconda search blpapi
Using Anaconda API: https://api.anaconda.org
Packages:
Name | Version | Package Types | Platforms | Builds
------------------------- | ------ | --------------- | --------------- | ----------
conda-forge/blpapi | 3.9.2 | conda | linux-64, win-64, osx-64 | py27h2d50403_0, py36he980bc4_0, py36h2d50403_0, py27hdc96acc_0
: Python SDK for Bloomberg BLPAPI (<=3.9)
dsm/blpapi | 3.9.0 | conda | linux-64, win-64 | py36_0, py27_0
josh/blpapi | 3.5.5 | conda | linux-64 | py27_0
macinv/blpapi | 3.9.0 | conda | linux-64, win-64 | py36_0, py27_0, py35_0, py34_0
mbonix/blpapi | 3.9.0 | conda | win-64 | py36_0
: Bloomberg's Open Market Data Initiative is part of the company's ongoing effort to foster open solutions for the financial services industry.
p-vg/blpapi | 3.9.2 | conda | linux-64, win-64 | py36h6538335_0, py27hc56fc5f_0, py36hf484d3e_0, py27hf484d3e_0
: interface for Bloomberg API services using the Python programming language
Found 6 packages
Depending on the version of python and platform you are interested in, there are a varierty of options available.
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
I have a perplexing problem.
I have used mac version 10.9, anaconda 3.4.1, python 2.7.6.
Developing web application with python-amazon-product-api. i have overcome an obstacle about installing lxml, referencing clang error: unknown argument: '-mno-fused-madd' (python package installation failure).
But another runtime error happened.
Here is the output from webbrowser.
Exception Type: ImportError
Exception Value:
dlopen(/Users/User_Name/Documents/App_Name/lib/python2.7/site-packages/lxml/etree.so, 2): Library not loaded: libxml2.2.dylib
Referenced from: /Users/User_Name/Documents/App_Name/lib/python2.7/site-packages/lxml/etree.so
Reason: Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0
I'm not sure how to proceed and have searched here and elsewhere for this particular error.
This worked for me:
brew install libxml2
brew install libxslt
brew link libxml2 --force
brew link libxslt --force
If using conda, force a reinstall of lxml:
$ conda install -f lxml
Note that forcing a reinstall may have unforeseen consequences.
I first tried conda update lxml to no effect.
Then tried conda install lxml also to no effect (but that was a while ago and ymmv -- see comment).
I was having this same issue. I realized that during pip install for my web app, lxml was attempting the following:
"Building against libxml2/libxslt in the following directory: /Users/[me]/anaconda/lib"
Not 100% sure why, but once I removed the anaconda/bin from my system path in bash_profile (anaconda sticks it in there when installing) I was able to pip install lxml correctly. After which you should be able to re-add anaconda/bin to your system path without issue.
I get this to work by doing the following:
conda install libxml2
Consider using an alternative channel in conda.
$ anaconda search -t conda pyquery
Using anaconda-server api site https://api.anaconda.org
Run 'anaconda show <USER/PACKAGE>' to get more details:
Packages:
Name | Version | Package Types | Platforms
------------------------- | ------ | --------------- | ---------------
CS109/pyquery | 1.2.9 | conda | linux-64, win-32, win-64, linux-32, osx-64
: A jquery-like library for python
asmeurer/pyquery | 1.2.6 | conda | osx-64
: https://github.com/gawel/pyquery
auto/pyquery | 1.2.8 | conda | linux-64, linux-32, osx-64
: https://github.com/gawel/pyquery
dan_blanchard/pyquery | 1.2.6 | conda | linux-64
: https://github.com/gawel/pyquery
hargup/pyquery | | conda | None-None, linux-64
: A jquery-like library for python
meloncholy/pyquery | 1.2.9 | conda | linux-64
: A jquery-like library for python
mhworth/pyquery | 1.2.8 | conda | linux-64, osx-64
: A jquery-like library for python
nbsantos/pyquery | 1.2.9 | conda | osx-64
: A jquery-like library for python
pdrops/pyquery | 1.2.8 | conda | linux-64, osx-64
: A jquery-like library for python
ziebel/pyquery | 1.2.9 | conda | linux-64
: A jquery-like library for python
Found 10 packages
Then, picking a channel, do:
conda install pyquery -c CS109
I tried almost all approaches above and failed. What worked for me was commenting out the
export DYLD_LIBRARY_PATH=/usr/lib
in my bash profile. This line is added by the anaconda installer automatically.