When trying to load some parquet files into pandas DataFrame, I get an error claiming that Pyarrow version should be at least 0.16.
If I check the version installed, I confirm that:
>>> import pyarrow
>>> pyarrow.__version__
'0.11.0'
However, when trying to install version 0.16, with
conda install -c conda-forge pyarrow=0.16
I see the following:
The following packages will be downloaded:
package | build
---------------------------|-----------------
arrow-cpp-0.16.0 | py37hf731a26_1 19.8 MB conda-forge
aws-sdk-cpp-1.7.164 | hba45d7a_2 2.1 MB conda-forge
boost-cpp-1.72.0 | h7b93d67_2 16.3 MB conda-forge
numpy-1.19.5 | py37haa41c4c_1 5.3 MB conda-forge
pyarrow-0.16.0 | py37h110162e_2 4.1 MB conda-forge
re2-2020.04.01 | he1b5a44_0 438 KB conda-forge
thrift-cpp-0.13.0 | h5aa387f_5 19.2 MB conda-forge
zstd-1.4.4 | h3b9ef0a_2 982 KB conda-forge
------------------------------------------------------------
Total: 68.1 MB
The following NEW packages will be INSTALLED:
boost-cpp conda-forge/linux-64::boost-cpp-1.72.0-h7b93d67_2
curl conda-forge/linux-64::curl-7.77.0-hea6ffbf_0
icu conda-forge/linux-64::icu-67.1-he1b5a44_0
pandas conda-forge/linux-64::pandas-1.2.5-py37h219a48f_0
python-dateutil conda-forge/noarch::python-dateutil-2.8.1-py_0
pytz conda-forge/noarch::pytz-2021.1-pyhd8ed1ab_0
thrift-cpp conda-forge/linux-64::thrift-cpp-0.13.0-h5aa387f_5
The following packages will be REMOVED:
orc-1.6.8-h58a87f1_0
The following packages will be DOWNGRADED:
arrow-cpp 4.0.1-py37hac2aefd_2_cpu --> 0.16.0-py37hf731a26_1
aws-sdk-cpp 1.8.186-hb4091e7_3 --> 1.7.164-hba45d7a_2
grpc-cpp 1.38.1-h36ce80c_0 --> 1.25.0-h213be95_2
libprotobuf 3.16.0-h780b84a_0 --> 3.11.0-h8b12597_0
lz4-c 1.9.3-h9c3ff4c_0 --> 1.8.3-he1b5a44_1001
numpy 1.21.0-py37h038b26d_0 --> 1.19.5-py37haa41c4c_1
pyarrow 4.0.1-py37he2832ee_2_cpu --> 0.16.0-py37h110162e_2
re2 2021.06.01-h9c3ff4c_0 --> 2020.04.01-he1b5a44_0
zstd 1.5.0-ha95c52a_0 --> 1.4.4-h3b9ef0a_2
Why pyarrow.__version__ returns 0.11 and the terminal ask for a DOWNGRADE from 4.0.1?
Your help is much appreciated.
EDIT to provide more information:
Doing: conda list pyarrow after activating my virtual environment returns:
# Name Version Build Channel
pyarrow 4.0.1 py37he2832ee_2_cpu conda-forge
However, if I start python, I check the library is not being load from my vritual environment but from outside:
>>> import pyarrow
>>> pyarrow.__file__
'/home/myuser/.local/lib/python3.7/site-packages/pyarrow/__init__.py'
And if I check my sys.path, what I see is the following:
>>> import sys
>>> sys.path
['', '/home/myuser/.conda/envs/myenv/lib/python37.zip', '/home/myuser/.conda/envs/myenv/lib/python3.7', '/home/myuser/.conda/envs/myenv/lib/python3.7/lib-dynload', '/home/myuser/.local/lib/python3.7/site-packages', '/home/myuser/.conda/envs/myenv/lib/python3.7/site-packages']
Is it relevant that '/home/myuser/.local/lib/python3.7/site-packages' appears before '/home/myuser/.conda/envs/myenv/lib/python3.7/site-packages'?
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.
For some reason I decided to upgrade setuptools. The so-called package plan that popped up when I ran conda install -c anaconda setuptools was as follows:
The following packages will be downloaded:
package | build
---------------------------|-----------------
certifi-2019.3.9 | py37_0 155 KB anaconda
pip-19.1.1 | py37_0 1.8 MB anaconda
python-3.7.2 | h8c8aaf0_10 17.7 MB anaconda
setuptools-41.0.1 | py37_0 680 KB anaconda
wheel-0.33.4 | py37_0 57 KB anaconda
wincertstore-0.2 | py37_0 13 KB anaconda
------------------------------------------------------------
Total: 20.4 MB
The following NEW packages will be INSTALLED:
pip anaconda/win-64::pip-19.1.1-py37_0
The following packages will be UPDATED:
certifi 2018.11.29-py36_0 --> 2019.3.9-py37_0
python pkgs/main::python-3.6.4-h6538335_1 --> anaconda::python-3.7.2-h8c8aaf0_10
setuptools pkgs/main::setuptools-38.4.0-py36_0 --> anaconda::setuptools-41.0.1-py37_0
wheel pkgs/main::wheel-0.30.0-py36h6c3ec14_1 --> anaconda::wheel-0.33.4-py37_0
The following packages will be SUPERSEDED by a higher-priority channel:
wincertstore pkgs/main::wincertstore-0.2-py36h7fe5~ --> anaconda::wincertstore-0.2-py37_0
However the upgrade broke other parts of my code which are really needed and cannot be updated. Hence I decide to roll back to the previous state. The most recent revisions from conda list --revisions are:
2019-02-12 15:10:38 (rev 12)
bzip2 {1.0.6 (conda-forge) -> 1.0.6 (anaconda)}
ca-certificates {2018.03.07 -> 2019.1.23 (anaconda)}
certifi {2018.11.29 -> 2018.11.29 (anaconda)}
conda {4.5.12 -> 4.6.2 (anaconda)}
nbconvert {5.3.1 -> 5.4.0 (anaconda)}
openssl {1.1.1a -> 1.1.1 (anaconda)}
snappy {1.1.7 (conda-forge) -> 1.1.7 (anaconda)}
vc {14.1 -> 14.1 (anaconda)}
vs2015_runtime {14.15.26706 -> 15.5.2 (anaconda)}
yaml {0.1.7 (conda-forge) -> 0.1.7 (anaconda)}
zlib {1.2.11 (conda-forge) -> 1.2.11 (anaconda)}
+defusedxml-0.5.0 (anaconda)
2019-05-17 16:52:29 (rev 13)
certifi {2018.11.29 (anaconda) -> 2019.3.9 (anaconda)}
pip {9.0.1 -> 19.1.1 (anaconda)}
python {3.6.4 -> 3.7.2 (anaconda)}
setuptools {38.4.0 -> 41.0.1 (anaconda)}
wheel {0.30.0 -> 0.33.4 (anaconda)}
wincertstore {0.2 -> 0.2 (anaconda)}
The problem now is that when I do conda install --revision 12 I get the following error:
PackagesNotFoundError: The following packages are missing from the target environment:
- anaconda::certifi==2018.11.29=py36_0
Any ideas how to do the rollback please?
Many thanks
It appears you are maintaining your environment by
issuing a series of conda install commands.
You could continue to do this,
with an additional version specification on the command line.
But I encourage you to switch to this approach:
Create an environment.yml file that looks like this.
name: myproject
channels:
- conda-forge
dependencies:
- bzip2 >= 1.0.6
- pip >= 19.1.1
- snappy >= 1.1.7
- zlib >= 1.2.11
Add others as needed.
Use conda env update to install the packages.
(With which python you can see where they were installed.)
An advantage of this approach is you can easily
rm -rf ~/miniconda3/envs/myproject/
(or wherever they were installed)
and then conda env update to re-install from scratch.
This typically resolves versionitis problems,
or at least offers a hint
about which version constraints should be relaxed
to permit a feasible solution.
EDIT
I personally favor >= constraints in my environment.yml files.
Sticking to modern versions is good for community support
when things go awry, and is good for speed of updates since
conda will have just a handful of modern versions to consider,
rather than trying to figure out how e.g. python2 might
play into the dependency constraints.
It helps me to learn of updates, and then I re-run
my automated unit tests upon pulling in newer deps.
Alternatively you can routinely store == constraints
to lock it down if desired, e.g. bzip2 == 1.0.6.
And if you haven't been doing that, you can still
checkout an old snapshot with e.g. bzip2 >= 1.0.5
and edit with global search-n-replace, changing >= to ==.
That will set the controls on the Time Machine to go
back in time to some consistent set of older dep versions.
If your conda env update run shows some rough edges,
consider nuking the environment and re-populating it from scratch.
Often a clean install like that will run more smoothly.
I had a similar issue where I could not role back to an older revision. After the command
conda install --revision N
I got a similar error message in the style
PackagesNotFoundError: The following packages are missing from the target environment:
- channel-name::package==v.v.v=build
- ...
What helped was to add the channel to the command
conda install --revision N -c channel-name
Just in case someone bumps into this, facing a similar situation, this what I did and to be fair, it is not actually a rollback. It also appears that my conda environment was really messed-up the upgrade I mentioning in my original post because when I did conda update conda I received the following error:
>conda update conda
Collecting package metadata: done
Solving environment: | WARNING
conda.common.logic:get_sat_solver_cls(289): Could not run SAT solver through interface "pycosat".
WARNING conda.common.logic:get_sat_solver_cls(289): Could not run SAT solver through interface "pycryptosat".
WARNING conda.common.logic:get_sat_solver_cls(289): Could not run SAT solver through interface "pysat".failed
My numpy was also broken and who knows what else....
I followed the steps desribed by Kale Franz at this link: https://github.com/conda/conda/issues/7714#issuecomment-417553149
For the sake of completeness, I am attaching a screenshot of his answer below:
Running the command that Kale suggests in his post, I got a really long list of the packages that are causing inconsistencies. I was a really long list, I am just pasting below the very first few lines:
Collecting package metadata: done
Solving environment: \
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
- defaults/win-64::alabaster==0.7.10=py36hcd07829_0
- defaults/win-64::anaconda-client==1.6.9=py36_0
- defaults/win-64::anaconda==custom=py36h363777c_0
- defaults/win-64::anaconda-project==0.8.2=py36hfad2e28_0
- defaults/win-64::asn1crypto==0.24.0=py36_0
- defaults/win-64::astroid==1.6.1=py36_0
.... (A lot more that I am not pasting here) ....
And after the list ended the message continued as follows:
The following packages will be downloaded:
package | build
---------------------------|-----------------
ca-certificates-2019.5.15 | 0 166 KB
certifi-2019.3.9 | py36_0 156 KB
cffi-1.12.3 | py36h7a1dbc1_0 225 KB
chardet-3.0.4 | py36_1 210 KB
conda-4.6.14 | py36_0 2.1 MB
cryptography-2.7 | py36h7a1dbc1_0 564 KB
idna-2.8 | py36_0 134 KB
menuinst-1.4.16 | py36he774522_0 227 KB
openssl-1.1.1c | he774522_1 5.7 MB
pip-19.1.1 | py36_0 1.9 MB
pycosat-0.6.3 | py36hfa6e2cd_0 98 KB
pycparser-2.19 | py36_0 174 KB
pyopenssl-19.0.0 | py36_0 82 KB
pysocks-1.7.0 | py36_0 30 KB
python-3.6.8 | h9f7ef89_7 20.3 MB
pywin32-223 | py36hfa6e2cd_1 9.3 MB
requests-2.22.0 | py36_0 90 KB
ruamel_yaml-0.15.46 | py36hfa6e2cd_0 262 KB
setuptools-41.0.1 | py36_0 663 KB
six-1.12.0 | py36_0 22 KB
urllib3-1.24.2 | py36_0 153 KB
wheel-0.33.4 | py36_0 57 KB
win_inet_pton-1.1.0 | py36_0 9 KB
wincertstore-0.2 | py36h7fe50ca_0 13 KB
------------------------------------------------------------
Total: 42.6 MB
The following packages will be UPDATED:
ca-certificates anaconda::ca-certificates-2019.1.23-0 --> pkgs/main::ca-certificates-2019.5.15-0
cffi 1.11.4-py36hfa6e2cd_0 --> 1.12.3-py36h7a1dbc1_0
conda anaconda::conda-4.6.2-py36_0 --> pkgs/main::conda-4.6.14-py36_0
cryptography 2.4.2-py36h7a1dbc1_0 --> 2.7-py36h7a1dbc1_0
idna 2.6-py36h148d497_1 --> 2.8-py36_0
menuinst 1.4.11-py36hfa6e2cd_0 --> 1.4.16-py36he774522_0
pycparser 2.18-py36hd053e01_1 --> 2.19-py36_0
pyopenssl 17.5.0-py36h5b7d817_0 --> 19.0.0-py36_0
pysocks 1.6.7-py36h698d350_1 --> 1.7.0-py36_0
pywin32 222-py36hfa6e2cd_0 --> 223-py36hfa6e2cd_1
requests 2.18.4-py36h4371aae_1 --> 2.22.0-py36_0
ruamel_yaml 0.15.35-py36hfa6e2cd_1 --> 0.15.46-py36hfa6e2cd_0
six 1.11.0-py36h4db2310_1 --> 1.12.0-py36_0
urllib3 1.22-py36h276f60a_0 --> 1.24.2-py36_0
win_inet_pton 1.0.1-py36he67d7fd_1 --> 1.1.0-py36_0
The following packages will be SUPERSEDED by a higher-priority channel:
certifi anaconda::certifi-2019.3.9-py37_0 --> pkgs/main::certifi-2019.3.9-py36_0
openssl anaconda::openssl-1.1.1-he774522_0 --> pkgs/main::openssl-1.1.1c-he774522_1
pip anaconda::pip-19.1.1-py37_0 --> pkgs/main::pip-19.1.1-py36_0
python anaconda::python-3.7.2-h8c8aaf0_10 --> pkgs/main::python-3.6.8-h9f7ef89_7
setuptools anaconda::setuptools-41.0.1-py37_0 --> pkgs/main::setuptools-41.0.1-py36_0
wheel anaconda::wheel-0.33.4-py37_0 --> pkgs/main::wheel-0.33.4-py36_0
wincertstore anaconda::wincertstore-0.2-py37_0 --> pkgs/main::wincertstore-0.2-py36h7fe50ca_0
The following packages will be DOWNGRADED:
chardet 3.0.4-py36h420ce6e_1 --> 3.0.4-py36_1
pycosat 0.6.3-py36h413d8a4_0 --> 0.6.3-py36hfa6e2cd_0
Proceed ([y]/n)? y
Everything looks fine now and If I do conda list --revisions my two most recent revisions are:
2019-05-17 16:52:29 (rev 13)
certifi {2018.11.29 (anaconda) -> 2019.3.9 (anaconda)}
pip {9.0.1 -> 19.1.1 (anaconda)}
python {3.6.4 -> 3.7.2 (anaconda)}
setuptools {38.4.0 -> 41.0.1 (anaconda)}
wheel {0.30.0 -> 0.33.4 (anaconda)}
wincertstore {0.2 -> 0.2 (anaconda)}
2019-06-10 14:05:10 (rev 14)
ca-certificates {2019.1.23 (anaconda) -> 2019.5.15}
certifi {2019.3.9 (anaconda) -> 2019.3.9}
cffi {1.11.4 -> 1.12.3}
chardet {3.0.4 -> 3.0.4}
conda {4.6.2 (anaconda) -> 4.6.14}
cryptography {2.4.2 -> 2.7}
idna {2.6 -> 2.8}
menuinst {1.4.11 -> 1.4.16}
openssl {1.1.1 (anaconda) -> 1.1.1c}
pip {19.1.1 (anaconda) -> 19.1.1}
pycosat {0.6.3 -> 0.6.3}
pycparser {2.18 -> 2.19}
pyopenssl {17.5.0 -> 19.0.0}
pysocks {1.6.7 -> 1.7.0}
python {3.7.2 (anaconda) -> 3.6.8}
pywin32 {222 -> 223}
requests {2.18.4 -> 2.22.0}
ruamel_yaml {0.15.35 -> 0.15.46}
setuptools {41.0.1 (anaconda) -> 41.0.1}
six {1.11.0 -> 1.12.0}
urllib3 {1.22 -> 1.24.2}
wheel {0.33.4 (anaconda) -> 0.33.4}
win_inet_pton {1.0.1 -> 1.1.0}
wincertstore {0.2 (anaconda) -> 0.2}
I agree with J_H, the best is to keep your environment.yml produced with conda env export > environment.yml in your code versioning system (Git). Then in case of problem you can delete your environment and recreate it (but not with conda env update) with conda env create -f environment.yml.
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'm trying to install Zipline and all of its dependencies using conda for Python 3.5. However, I'm only getting the 2.7 versions of the files:
The following packages will be downloaded:
package | build
---------------------------|-----------------
logbook-0.12.5 | py27_0 111 KB quantopian
zipline-0.7.0 | np18py27_0 241 KB quantopian
ta-lib-0.4.8 | np18py27_0 6.3 MB quantopian
------------------------------------------------------------
Total: 6.7 MB
The following NEW packages will be INSTALLED:
asn1crypto: 0.24.0-py27_0
backports: 1.0-py27_1
backports.functools_lru_cache: 1.5-py27_1
backports_abc: 0.5-py27h6d9a788_0
ca-certificates: 2018.12.5-0
cffi: 1.11.5-py27hc64555f_1
chardet: 3.0.4-py27_1
cryptography: 2.4.2-py27hc64555f_0
cycler: 0.10.0-py27h0308610_0
dateutil: 2.4.1-py27_0
enum34: 1.1.6-py27_1
freetype: 2.9.1-h4d385ea_1
functools32: 3.2.3.2-py27_1
futures: 3.2.0-py27_0
icu: 58.2-hb13015a_1
idna: 2.8-py27_0
ipaddress: 1.0.22-py27_0
jpeg: 9b-hb117b5b_2
kiwisolver: 1.0.1-py27hc56fc5f_0
libpng: 1.6.36-h7a46e7a_0
logbook: 0.12.5-py27_0 quantopian
matplotlib: 2.2.3-py27h263d877_0
numpy: 1.8.2-py27_0
openssl: 1.0.2p-h0c8e037_0
pandas: 0.14.1-np18py27_0
pycparser: 2.19-py27_0
pyopenssl: 18.0.0-py27_0
pyparsing: 2.3.1-py27_0
pyqt: 5.6.0-py27hc56fc5f_6
pysocks: 1.6.8-py27_0
python-dateutil: 2.7.5-py27_0
pytz: 2018.9-py27_0
qt: 5.6.2-vc9he136c73_12
requests: 2.21.0-py27_0
scipy: 0.14.0-np18py27_0
singledispatch: 3.4.0.3-py27h18657b7_0
sip: 4.18.1-py27hc56fc5f_2
six: 1.12.0-py27_0
sqlite: 3.26.0-h0c8e037_0
ta-lib: 0.4.8-np18py27_0 quantopian
tornado: 5.1.1-py27h0c8e037_0
urllib3: 1.24.1-py27_0
vs2008_runtime: 9.00.30729.1-hfaea7d5_1
win_inet_pton: 1.0.1-py27_1
zipline: 0.7.0-np18py27_0 quantopian
zlib: 1.2.11-h3cc03e0_3
The following packages will be UPDATED:
certifi: 2018.8.24-py35_1 --> 2018.11.29-py27_0
pip: 10.0.1-py35_0 --> 18.1-py27_0
setuptools: 40.2.0-py35_0 --> 40.6.3-py27_0
wheel: 0.31.1-py35_0 --> 0.32.3-py27_0
wincertstore: 0.2-py35h3d52121_0 --> 0.2-py27h87a2792_0
The following packages will be DOWNGRADED:
python: 3.5.6-he025d50_0 --> 2.7.15-hcb6e200_5
vc: 14.1-h0510ff6_4 --> 9-h7299396_1
Proceed ([y]/n)? n
I can see that Python 3.5 files are available on Anaconda. How do I specify that I want the Python 3.5 files, not the 2.7 ones?
I ran the following commands from the Anaconda prompt:
conda create -n py35 python=3.5
conda activate py35
conda install -c Quantopian zipline
This happened to me as well. I quitted the zipline installation process and installed some other packages instead. Then I tried to install zipline again, and conda did not asked to downgrade python anymore. So I guess it is just some automatic environment solving mechanism with conda. You can try install zipline first, then upgrade python back to 3.5 again.
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.