How to use Python3.4 with Anaconda? - python

I want Anaconda to use Python 3.4, but I don't know how to do it.
In Anaconda, Python version switching can be done using Anaconda Navigator, but Anaconda Navigator 1.9.7 does not seem to support Python3.4.
I need Python3.4 to use py2exe, so how can I use Python3.4 with Anaconda?
I tried the following code at conda prompt.
conda install python=3.4
However, I got the following error.
PackagesNotFoundError: The following packages are not available from current channels:
- python=3.4

Have you tried creating an environment? I'd refer to the documentation you might find that helpful here https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
Try doing something like:
conda create -n myenv python=3.4
conda install -n myenv py2exe
To create an environment and then select the environment in the Anaconda Navigator

Related

different python versions in anaconda and windows cmd , pip install not working

I want windows command prompet to work on the same version anaconda prompet witch is 3.9
also I want windows command prompet to run and install pip packages like opencv-python
With Anaconda you have conda for enviornment handling. Have a look at conda enviornments and how to install packages with conda.
In the Anaconda Prompt with Admin rights you can do:
conda create -n py39 python=3.9
activate py39
conda install -c conda-forge opencv
Then you can use your new env in any command prompt with:
activate py39
Maybe it's better to use:
anaconda prompt
In windows 10 search box search for anaconda prompt
python virtual environment.
https://docs.python.org/3/tutorial/venv.html

Creating a new environment in conda with python 3.5 on Mac

I am trying to create a new environment named cv_env having python 3.5 , with this line -
conda create --name cv_env python=3.5
Although it gives an error,
PackagesNotFoundError: The following packages are not available from current channels:
python=3.5
I uninstalled and installed anaconda. This time the command worked.

Unable to update or install any package

I am trying to update matplotlib but getting an error. Error message : EnvironmentNotWritableError: The current user does not have write permissions to the target environment. environment location: C:\Users\DeepakKumar\Anaconda3 How to fix this issue?
Some Specs:
Anaconda3 2019.10
Python 3.7.4 64-bit
matplotlib 3.1.1
If you are using Windows, try to open your shell as an administrator and then run pip/conda install that will install it.
Also, I highly recommend using virtual environments to install libraries and avoid conflict in dependencies.
You can use virtualenv: https://virtualenv.pypa.io/en/latest/
Or conda management environemnts.
Basically, you create a new environment:
conda create -n my_env
conda activate my_env
conda install matplotlib
This will avoid these kind of problems.
You can also read more about it here: conda-envs
Search for Anaconda Prompt, Run the Prompt as Administrator (Right Click and select Run as Admin), then use conda update <package>, this shall solve your current issue, but this is just a workaround.
As Admin you should run conda update -n base -c defaults conda. This way your Anaconda should now update without admin related errors.

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

Decrementing Python

I've got a package that depends on an earlier version of Python -- I'm running 3.5.1, but the package only supports up through Python 3.4. I'd like to clone my current environment, decrement my Python version to 3.4, and then update all other packages to the latest version compatible with Python 3.4. How do I do that?
When I clone my root environment and attempt:
conda install python=3.4
I receive the message:
Error: 'conda' can only be installed into the root directory.
I'm working on Windows currently. Any ideas would be much appreciated.
Create a new environment:
conda create -n py34 python=3.4
activate it:
source activate py34
(no source on Windows)
Install all your packages:
(py34) conda install package1 package2
This keeps your original Python 3.5 install and you can activate Python 3.4 whenever you need it. Deactivate with deactivate.
You can export names and versions of all packages you have currently installed with:
conda list --export > list_of_my_packages
Use this file to create your new py34 environment:
conda create --file list_of_my_packages -n py34 python=3.4
You might get a warning about packages missing form the current channels.
Either add more channels or edit this list, opening the file in an editor.
Finally, you can update all packages to the latest version with:
conda update all

Categories

Resources