Remove Path from Conda env - python-3.x

I'm currently running Python 3.7.6 (64bit) in a few Conda envs, all of them I use to work in jupyter.
I added Jupyter outside of conda for my qgis python 3.7 (32bit) and all my conda envs now point to this kernel and refuse to work for everything except qgis.
I've worked around this by deleting the entire path and all the conda kernels launch again, which then breaks the qgis kernel.
Is there a way I can easily remove the python 3.7 paths from the conda envs so they ignore it?
Or should I just not use the python that comes with qgis and build a conda env from scratch?

Related

How to install Spyder-terminal in Python 3.8 or 3.9 with Spyder v4.3.x or Spyder 5.0.x

Spyder-terminal does not install with Anaconda Navigator running Python v3.8 or v3.9 or v3.10.
My question is "Is there a way to install the Spyder-Terminal Plugin using Anaconda Navigator running Python 3.8 or 3.9 or 3.10, and use Spyder v5.x " ?
Is there a hack for this to run inside Spyder 5.0.x on Python 3.8, 3.9 or 3.10, WITHOUT creating a new virtual environment?
My Software Versions
Spyder-Terminal Version: spyder-terminal-0.5.0 (spyder-ide/win-64)
Python Version: 3.8 or 3.9
Anaconda v2.0.1
Operating system: Windows 10
What I tried:
I tried installing 'conda install -c spyder-ide spyder-terminal' from Anaconda Command Prompt. I did several trials with MANY errors to learn that Spyder-terminal only works with Spyder v4.2 and NOT Spyder v5.0.3.
Spyder-terminal is (nominally) supposed to work in Python 3.9. So I tried upgrading Anaconda base environment to Python 3.9. However, that BROKE the Anaconda base environment, which required uninstalling and reinstalling the entire Anaconda distribution. (What a hassle. Good thing this was on someone else's computer! 8^))
I finally got it to work in a separate conda virtual environment running Python 3.6. Just to be conservative, I used Python 3.6 instead of Python 3.7. (I later installed Spyder-Terminal in a Python 3.7-based virtual environment and it worked fine.)
The steps that finally worked were to Create a new conda environment with Python 3.6 and install spyder-terminal and spyder-notebook there.
I used the following commands...
conda create -n python36 -c conda-forge python=3.6
conda install spyder-terminal -c conda-forge spyder-ide
conda install spyder-notebook -c conda-forge spyder-ide
The correct version of Spyder (for Python 3.6) was installed along with all of its correct dependencies.
What steps will reproduce the problem?
try installing into an Anaconda distribution with Python 3.8 or Python 3.9 kernels
Wait a long time and get many errors.
Rip out a few locks of hair (preferably someone else's)
**What is the expected output?
Spyder-Terminal plugin installs and is available for use.
What do you see instead?
A bunch of errors. The exact errors were lost when I closed the installation console.
Suggestions
The Spyder-terminal plugin failed repeatedly in Anaconda "base" running v3.8.x or a new environment running v3.9.x. I used a new conda virtual environment, running Python 3.6 runtime kernel and install spyder-terminal there.
The Spyder-terminal installer should do version checks for Python and Spyder FIRST, warn the user, and stop if they are not using Python 3.6 or Python 3.7.
Clearer documentation for Spyder-Terminal plugin installation on the Github.com home page (or built into Spyder Menu "Help" will help the "HELP" system. These docs should state WHICH version(s) of Spyder and Python that Spyder-Terminal v0.5.x requires. A dependency table would also be useful.

anaconda launches the wrong python and spyder version

I installed anaconda on ubuntu 18 (not for the first time) and created a new environment (using the navigator) with python 3.7 (in addition to the 3.8 in the base environment). I installed spyder in the new environment, but when launching it using the navigator, I get the spyder of the base environment (with python 3.8). The only way I found around this is to activate the new environment from the terminal and type "spyder" which launches the correct version. Any ideas why the navigator directs to the wrong spyder version?
You can easily maintain separate environments for Python 3.7 programs and Python 3.8 programs on the same com:
conda create --name py3 python=3.7
or
conda create -n py37 python=3.7
Activate and use the Python 3 environment.in Linux:
conda activate py37

downgrade python version from 3.8 to lower one in a given conda environment

In one existing conda environment, the python is 3.8. Is that possible to downgrade the python version for this specific environment from 3.8 to 3.6 or 3.7?
Check this,
Open your terminal and search for available versions using the following command.
conda search python
If the python version you are searching is available then use the command
conda install python=3.8 (0r 3.6 or 3.7 depending to your requirement)
This will change the python version in a specific environment.
Note: This command will overwrite the default python version.
I suggest you open a new conda environment using the following command.
conda create --name py38 python=3.8
//This lines will create a new environment named py38
Now you can work into this environment without interfering with the libraries of the other environment.
Hope this will help you.

Spyder crashing after installing Keras through Conda

I downloaded Anaconda on a PC. I would like to use TensorFlow and Keras. I know I have to use Python 3.6 and TensorFlow 1.0.9 (because of my code).
After installing Anaconda, I open my Anaconda prompt (in admin) and I put these instructions to create a new env:
conda create --name deeplearningaz python=3.6 anaconda
activate deeplearningaz
conda install theano
conda install tensorflow
conda install keras
conda update --all
I don't have any errors, but a warning about updating Conda version, and a few debug messages.
After that, I try to check if I'm using the correct version of Python, so I type (still in Anaconda prompt) and import keras (to see if it's ok):
python
import keras
Everything works perfectly fine.
Then I type quit() and type spyder (to open the Spyder from the env in Python 3.6).
Spyder opens, and if I type anything (import pandas, numpy et read a csv), then it crashes... for no reason (and no error).
After that, still in the Anaconda prompt, I try again to open Spyder and I get an error:
I don't get the problem, I try again and again to uninstall and install anaconda (and checking if my file was really delete). I didn't find...
I check the print(sys.path) and it looks like it's ok (but I don't see the env).
Does anybody have any idea?
I put here the conda info in the env (before the crash).
I don't use Spyder, but based on this discussion about how they don't really support switching conda envs yet, it sounds like currently the correct way to get Spyder to use a Conda env is to launch Spyder from outside the env, and then change the Python interpreter (Tools > Preferences > Python Interpreter) to point to the python located inside the env you wish to use.
Or if you really don't care about space, simply install a new Spyder instance in the env (conda install -n deeplearningaz spyder), and then you should be able to launch within the env without issue.

Changing Default Python env.(from 2.7 to 3.3) in Anaconda on Mac OS 10.8

I have the Anaconda distribution installed for Mac. I have Mac OSX 10.8 (Mountain lion). The problem I don't often use Anaconda is because the default Python which it uses is 2.7 while I work on 3.3 or atleast prefer to work on that.
I really like the Spyder IDE of Anaconda. Is there a way I can get the default environment on Anaconda changed to 3.3 instead of 2.7 so that Spyder and iPython all use 3.3 default?
I see the following help from Anaconda site:
$ conda create -n py3k python=3 anaconda
Here python=3 and anaconda are package specifications, and it is the job of the SAT solver inside conda to find a consistent set of packages which satisfies these requirements. As the root environment uses Python 2, we had to specify the major version explicitly.
After adding the binary directory of the newly created environment to the PATH environment variable, which may be done using
$ source activate py3k
My question is I have separately installed Python 3.3 and associated Scientific Python packages like Pandas, numpy, scipy, scikit-learn etc using Homebrew so that it doesn't conflict with my Mac OS default Python 2.7. So now if I run the above Conda commands in Mac Terminal will it interfere with other Python packages I have installed using Homebrew? or will it automatically install/upgrade the python and other packages in the Anaconda library without interfering with either the Homebrew installed Python or Mac OS default Python?
Please advise.
No, the Homebrew and Anaconda Pythons will stay completely independent of one another. Just make sure you don't have PYTHONPATH set, which causes this to not be true.
Also, you should know that Spyder is not available for Python 3 in Anaconda yet, because PySide has not yet been built for Python 3.
I had installed Anaconda with python 2.7, but even after adding python3:
conda create --name Py3 python=3
spyder continued to call python2.7
creating an environment with BOTH spyder and python=3 worked for me:
conda create --name SpyPy3 python=3 spyder

Resources