Anaconda move to Python 3 - python

I am trying to make my Anaconda Python 2 into Python 3 on my Mac, and have been trying almost everything now. Preferably I would want to move to 3.6 but I am yet to manage to get any Python 3 version working. I started with conda install python=3.6 but got dependency errors. Then I though if I download the Anaconda installer maybe it will update everything and there will be no more dependency errors, but the installation program told me to run conda update anaconda. I still get dependency errors though. This is what I get right now:
For version 3.6:
$ conda install python=3.6
Fetching package metadata .........
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
- argcomplete -> python 3.3* -> openssl 1.0.1*
- argcomplete -> python 3.3* -> xz 5.0.5
- python 3.6*
Use "conda info <package>" to see the dependencies for each package.
and for version 3.5:
$ conda install python=3.5
Fetching package metadata .........
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
- backports_abc -> python 3.4*
- python 3.5*
Use "conda info <package>" to see the dependencies for each package.
What am I doing wrong and what must I do? (also, why is this so complicated?)
Update: Inspired by https://docs.continuum.io/anaconda/install I tried uninstalling like:
$ anaconda-clean -y
Backup directory: /Users/jonathan/.anaconda_backup/2017-04-24T160137
followed by the installation program again. The installation failed, anaconda is still supposed to be installed...

I know that you have uninstalled and reinstalled but you can create environments with other versions of Python.
conda create --name py36 python=3.6 anaconda
source activate py36
This would create an environment with Python 3.6 and all of the default packages in Anaconda.

You can always create different versions of python in different folders. Simply specify the python version you want to use in a NEW folder. And then activate it.
conda create -n myProject python=3
source activate myProject

I ended up removing the anaconda directory and reinstalling.

Related

Update python from 3.5 to 3.6 in conda

I want to upgrade my python version from 3.5 to 3.6 to use the new features.
I first copy the base env as base3.6 using Clone base environment in anaconda,
then I want to upgrade the python3.5 to 3.6 using conda install python=3.6, but I have this error
(base3.6) D:\Desktop\GOC-VRPTW-master>conda install python=3.6
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- defaults/win-64::psutil==4.3.1=py35_0 -> python=3.5 -> python_abi=[build=*_cp35m] -> pypy[version='<0a0']
- python=3.6
Use "conda info <package>" to see the dependencies for each package.
Similar problem, but different in details conda install python=3.6 UnsatisfiableError
I find that reinstalling a new environment is a better choice.

How can I install zipline using conda with python 3.5

I am on macOS Sierra 10.12.5
My end goal is to install the zipline python package and get it to run properly. However, I have hit some obstacles and since I am new to Unix and python as well, I thought maybe someone could push me in the right direction.
On the zipline website it says there is support for python 3.5. I already have python 3.6 installed via conda on my system so I decided to create an environment for the former version.
First, I did conda create -n py35 python=3.5 anaconda in the directory /anaconda/envs/py35. This installed python 3.5.3. Then, I use source activate py35 to activate it.
Next, I attempt to install zipline using a suggestion on their website with the command:
conda install -c Quantopian zipline
And I receive this error back:
Fetching package metadata ...........
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in
conflict:
- python 3.5*
- zipline -> logbook -> python 2.7*
Use "conda info <package>" to see the dependencies for each package.
I'm not sure I fully understand why python 2.7 would be in conflict if I am working from within an environment, I assumed that was the point, so nothing conflicts with other python versions. Also, it says python 3.5* does that mean it's in conflict with itself? Thanks for the help.
As discussed in comment:
pip install zipline
did you give pip install zipline a try. A lot of times conda doesn't work for me, whereas pip does.
--
#VikashSingh Yes, I am trying it now, pip did install zipline but when I attempt to run a buyaapl.py script I get an error No module named pandas.tseries.tools
I have no clue what buyaapl.py is. Please start another question and share the code as well.
PS: Probably you don't have pandas installed in the environment. Try pip install --upgrade pandas
You should run the conda install -c Quantopian zipline after you activated your conda environment.
source activate py35
Then, when you see your shell becomes (py35)$, you can run conda install -c Quantopian zipline again.
ref: http://www.zipline.io/install.html

Installation failed while installing pydoop using conda

I have anaconda installed on ubuntu, i am using spyder for python development
I am trying command
conda install -c ijstokes pydoop
it is giving:
Fetching package metadata .............
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
- pydoop -> python 3.5* -> openssl 1.0.1*
- pydoop -> python 3.5* -> xz 5.0.5
- python 3.6*
Use "conda info " to see the dependencies for each package.
Dont know what to do next please help.
The error states that there is a version conflict between pydoop which has a dependency on python 3.5* and python 3.6*. The easiest way to fix this is to make an environment with Python 3.5.
conda create -n py35 -c ijstokes python=3.5 pydoop
This package for conda is fairly old. Why not try to install pydoop from pypi?
pip install pydoop

conda install downgrade python version

I'm trying to downgrade python version of anaconda via conda install python=3.3, but have following error:
~/anaconda3/bin$ ./conda install python=3.3
Fetching package metadata .........
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
- gevent -> python 2.6*
- python 3.3*
Use "conda info <package>" to see the dependencies for each package.
How to resolve conflicts with the packages?
If you want to set specific version, use it like this:
WARNING: This command will overwrite the default python version system-wise
conda install python=3.6
To create environment with a specific version, you can do:
conda create -n $PYTHON36_ENV_NAME python=3.6 anaconda # set custom env name
The anaconda at the end allows the env to use all anaconda packages
For more information refere to Anaconda documentation
There are two ways to downgrade python in anaconda.
1. Downgrade python in the active environment
(This can lead to conflicts with installed packages for higher python versions)
conda activate nameOfYourEnvironment
conda install python=3.3
2. Create a new environment
(This is a more safer way, but you need to install all necessary packages again)
conda activate base
conda create --name env_name python=3.3
Hint: Use conda list before creating a new environment to get the names of all installed packages in the actual environment.
If you want to check your installed environments do:
conda env list
If you got problems in installing, make sure to run the shell as administrator (always recommended).
You can make environments with other versions of Python using this command:
conda create --name py33 python=3.3
source activate py33
Very firstly check the current version using command python --version. Then on anaconda prompt type the command conda search python which will list all the python versions available till date. Then from that list select your version and type conda install python=3.5.2 or any of your choice

Conflict while installing ggplot to conda python 3 environment

I tried to run
conda create --name test python=3
source activate test
conda install -c conda-forge ggplot=0.11.5
but after the last command I get
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: ....
The following specifications were found to be in conflict:
- ggplot 0.11.5* -> python 2.7*|3.4*|3.5*
- pip (target=pip-9.0.1-py36_1.tar.bz2) -> python 2.7*|3.4*|3.5*
- pip (target=pip-9.0.1-py36_1.tar.bz2) -> setuptools
- python 3.6*
- setuptools (target=setuptools-27.2.0-py36_0.tar.bz2) -> python 2.7*|3.4*|3.5*
- wheel (target=wheel-0.29.0-py36_0.tar.bz2) -> python 2.7*|3.3*|3.4*|3.5*|3.6*
- wheel (target=wheel-0.29.0-py36_0.tar.bz2) -> setuptools
Use "conda info <package>" to see the dependencies for each package.
I am able to run
conda install -c bokeh ggplot=0.9.4
instead, but that is an older version. I am not sure what would be a practical way of resolving this if I want to use the newer version of ggplot.
I could install the newer version in python 2.7 though.
Running 'conda create --name test python=3' will create a Python 3.6 environment by default.
If you take a look here: https://anaconda.org/conda-forge/ggplot/files you will see that the conda-forge version of ggplot is not compatible with Python 3.6. If you create an environment with Python 3.5 then you will be able to run this command again and successfully install your desired version of ggplot.
conda create --name test1 python=3.5
source activate test1
conda install -c conda-forge ggplot=0.11.5

Categories

Resources