I currently use this command to create a new anaconda environment:
conda create --name=<myEnvNameHere> python=3.9.5
I determined that 3.9.5 is the latest version of python available in anaconda with this command:
conda search -f python
How can I use just one command to create a new environment with the latest available version of python, perhaps something like:
conda create --name=<myEnvNameHere> python=latest
I know I can write a script to achieve the outcome I am after, but is there a way to do it in the conda create command natively?
According to the documentation for conda install, conda will (when no version is specified, it seems) try to install the latest version of the specified package(s).
Hence, you should be able to get the latest version of python in your new environment by running a command like this.
conda create --name=<myEnvNameHere> python
I currently have python3 set as my default python version but I'd like to be able to switch back to python2 for certain things so I created a conda environment with the following command:
conda create -n py2 python=2.7
and then activated it with:
source activate py2
but when I do:
python --version
I still get
Python 3.6.8
What am I doing wrong here? I'm trying to download a conda package this is only python2 compatible but despite being in a python2 environment, it keeps telling me my python version is incompatible.
You might be running into the issue where you have multiple environments on top of one another.
Try running:
conda deactivate
multiple times in order to exit from all of the environments. Then run:
condo activate py2
It makes me crazy, In anaconda I create the environment with the defualt iterpreter python3.4 Next I install pytorch 0.4.1
conda install pytorch=0.4.1 cuda80 -c pytorch
After this I found that the pytorch was installed in python3.6!
And the environment defualt interpreter is chaged from python3.4 to python3.6.
I am very confused what happend ? How shoud I fix it back? change defualt python back to python3.4? Hope some one could help me.
The commands I typed in are as follows:
conda create -n pointgen python=3.4 ipykernel
source activate pointgen
conda install pytorch=0.4.1 cuda80 -c pytorch
Thats all. What Novak said is right, there is remaining question is how could I manually change the python version from 3.6 back to 3.4, is there any config file I can deal with?
As you can see here there is no version of pytorch for python3.4... The default version of pytorch is for python3.6 and that is the version you installed installed. In the process anaconda prompts you that it will have to upgrade/downgrade some package versions and there is probably the the line in which it says it will upgrade python to 3.6
Am new to programming and have no idea even how to install TensorFlow, as it's not a one-step process.
Can any give or at least refer to a definitive tutorial for installing Tensor Flow in Windows.
Thank You!
:D
Not exactly sure what you have looked up so far, but this was the first result doing a google search.
Link: https://www.tensorflow.org/install/install_windows
In windows, Tensorflow only works in 64 bit and with python 3.5. I don't know what you have installed but following the code below exactly will create a 64-bit python 3.5 environment and install Tensorflow in it for you. To activate or deactivate this environment, you would simply type :
set CONDA_FORCE_32BIT=
conda create --name name_of_your_created_environment python=3.5
activate name_of_your_created_environment
conda install -c conda-forge tensorflow
CONDA_FORCE_32BIT=1 sets to a 32-bit environment whilst CONDA_FORCE_32BIT= sets to a 64-bit environment.
To deactivate this new environment and return to the original environment you use daily, just type:
deactivate name_of_your_created_environment
You can always return to this environment to use Tensorflow by re-typing:
activate name_of_your_created_environment
I have installed Python version 3.5 and 3.6 and anaconda.
The following error occures when trying to install tensorflow following the steps here
https://www.tensorflow.org/install/install_windows
unsing anaconda
(tensorflow) C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
tensorflow-1.0.1-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
As I am new to Python, I do not know how to circumvent this probelm.
I am using Win10 with 64bit.
Thanks a lot and best,
Martin
I ran into the same difficulties with the same error. It seems to be that Python 3.6 isn't immediately supported and found a sort of workaround here (note that this involves installing Python 3.5 which I did not already have installed, I don't know if this should be done a different way if its already installed):
If you are using anaconda distribution, you can do the following to use python 3.5 on the new environment "tensorflow":
conda create --name tensorflow python=3.5
activate tensorflow
conda install jupyter
conda install scipy
pip install tensorflow
\# or
\# pip install tensorflow-gpu
It is important to add python=3.5 at the end of the first line, because it will install Python 3.5.
If you've already created the tensorflow environment (the conda create step), you'll have to delete it and start over. Otherwise, you'll run into an error "CondaValueError: Value error: prefix already exists: C:\[your environment location]" (If you run into the unsupported wheel error, then you probably created the environment already.)
To delete your previous environment, according to the Conda Cheat Sheet, you first deactivate from (tensor flow) if needed by calling deactivate, then call conda remove --prefix ~/bioenvcopy --all. For ~/bioenvcopy I believe you use the tensorflow environment path. The location can be found by calling conda info --envs (citing the cheat sheet once again). Mine, for example, was conda remove --prefix ~/Anaconda3/envs/tensorflow
I successfully used this work around on Windows 10.
This solution probably be obsolete when 3.6 is supported.
Creating the tensorflow env without the correct python version did not work for me. So I had to do the following, which worked...
>deactivate tensorflow # start by deactivating the existing tensorflow env
>conda env remove -n tensorflow # remove the env
>conda create -n tensorflow python=3.5
>activate tensorflow
i had the same problem in windows 10 and python 3.6
so i navigated to anaconda navigator ( just search anaconda navigator in start search).
in the Environment tab you can create/delete your environments.
just create an environment, name it tensorflow and choose python 3.5 as python version.
then you can activate tensorflow in your command line:
activate tensorflow
and install tensorflow with :
pip install tensorflow #or tensowrlow-gpu
I had the same problem after hours of searching, I found that to save yourself from installing error problem in tensorflow. The convenient way for installing tensorflow is by creating a virtual environment in Conda with python 3.5.2 and using Conda-forge. This is done by running this commands:
conda create -n tensorflow python=3.5.2
activate tensorflow
conda config --add channels conda-forge
conda install tensorflow
Try installing the 64-bit version of Python 3.6.8:
https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe
I was getting the same error with the same OS and that's what fixed it. Apparently Tensorflow doesn't work on 32-bit Python even if your OS is 64-bit.
Try uninstalling everything (python, etc.) and try again using the cmd only, not git bash or PowerShell.
https://github.com/tensorflow/tensorflow/issues/9264
In Anaconda prompt, follow the instruction on Installing with Anaconda,
conda create -n tensorflow
activate tensorflow
Then the third step is a little different, try:
pip install tensorflow
This should work, good luck! If anything wrong happens, please let me know.