Why isn't Anaconda for Windows Installing Properly? - python

Anaconda 2 and 3 are installing without errors. I reboot because the installer prompts me to do so. When I open the Anaconda Prompt, python, pythonw or activate.bat aren't found. Looking in the Anaconda[2|3] folder, I can't find expected .exe and .bat files. What's going wrong?
I also notice that conda update --all wants to update many libs and eventually errors out.

Anaconda installs and updates can silently fail due to conflicts with 3rd party antivirus (for me it's WebRoot) programs. An indicator of Anaconda antivirus conflicts is missing .exe and .bat files, and sometimes requests to reboot. The fix is to shutdown the antivirus program and reinstall Anaconda. I suspect Anaconda isn't following correct Windows installer procedures as it's the only installer than conflicts with WebRoot.

INSTALL IT IN A EXTERNAL DISK!
I had a hard time tryig to install anaconda, because it was never complete, always missing anaconda navigator and the prompt. And after a cicle of install/unistall adopting different approaches, the only thing that made anaconda finally work properly in my computer was installing it in a exterior disk (or a pen drive).It just solved my problems, so give it a try!

Inspired from : https://github.com/ContinuumIO/anaconda-issues/issues/732#issuecomment-
****** UNINSTALL ALL PYTHON INSTALLATIONS, OTHERWISE THEY WILL GET MESSED UP AND YOU CANNOT CLEANLY UNINSTALL THEM WITHOUT WINDOWS RESTORE, or at least I think these two problems were related *****
Install Miniconda
As Admin open CMD and change to directory where Miniconda is installed
pythonw.exe -E -s "Lib_nsis.py" addpath
pythonw.exe -E -s "Lib_nsis.py" mkdirs
pythonw.exe -E -s "Lib_nsis.py" mkmenus
run conda init to start the environment. Then exit that CMD
I then ran Anaconda prompt from start menu, but you likely can use CMD
note) if you run "conda list", you will see no packages installed, but good news is conda will install pacakges, so:
conda install numpy
note) this will install conda! lol
conda install anaconda

Related

pipenv install/pipenv shell not working with Git Bash on Windows 10

I am having a hard time getting the pipenv install and pipenv shell commands to work when using Git Bash for Windows 10. When using powershell, I am able to successfully create a new virtual environment and use pipenv shell to enter the environment, but when using bash, nothing happens and it just proceeds to go to a flashing prompt.
Bash recognizes other commands like pip list, but pipenv doesn't seem to be working for me. I am very new to all of this so I may be missing something obvious, but I have searched for this issue to the best of my ability and even went through the pipenv documentation.
My software versions are:
Windows 10 Home 21H1
git version 2.35.1
bash version 4.4.23
Python 3.10.2
Update: So I feel like an idiot, but am still left with a question. I have been fooling with this since yesterday and after posting, I remembered when I had installed a virtual environment using venv using the command 'python -m venv', so I tried running 'python -m pipenv install' and it worked. I also have to use 'python -m pipenv shell' to launch the shell.
Why do I have to do this? Every tutorial I've watched on setting up my environment and installing pipenv has just used pipenv install/shell.
I just got the same issue and I doubt it's an issue in pipenv.
I resolve this by uninstalling the latest version 2022.1.8 of pipenv and install the version of 2021.5.29, which is a working version on my another PC.
In case you don't know how to do this:
pip uninstall pipenv
pip install pipenv==2021.5.29
Update: after downgrade to 2021.5.29, and then upgrade to the latest version, it still works. Now I have no idea what is the root cause.

python, anaconda, Spyder -- uninstalling python package using pip DOES NOT work in Spyder + ipython

By using pip, I can successfully install new packages in ipython running in the Spyder environment. All I need to run is this:
!python -m pip install mypackage
However, trying to uninstall packages doesn't seem to work, at all. When I run:
!python -m pip uninstall mypackage
The console goes into a state of hanging. It's not strictly 'hanging' because neither Spyder nor the console hangs but the command just isn't returning anything
I am attaching a screenshot to help explain what I mean. The screenshot shows what happens AFTER I have pressed ENTER on this line - and nothing happens!
Does anything know why?
You should not use pip with Spyder. It can break your whole distribution. Spyder is part of the Anaconda package and you should use the conda command instead of pip. The conda command works similar to the pip command. Instead of pip install package you'd use conda install package.
(Spyder maintainer here) Both pip and conda are not meant to be run inside one of our IPython consoles because they expect to be running in a real system terminal (xterm, Terminal.app or cmd.exe).
In this case, pip expects input from the user (the confirmation that he/she really wants to uninstall a package). That confirmation can't be displayed in our consoles and it makes it looked like its blocked.
What you could do is to pass the -q option to pip to avoid confirmation. But in general it's a very bad idea to use pip and conda inside our consoles for the reasons I stated above.
I have a windows 10 64 bit machine, i installed spyder with pip and it could not work. so to uninstall i just used this command
pip uninstall spyder
however, if spyder has been installed with alongside Anaconda, Uninstalling Anacanda will delete its all packages including spyder.

Anaconda install fails. Install vscode fails

I cannot install 64-bit Anaconda 3 on Windows 10. It says the install is complete but when I proceed to install VSCode, it fails. It says to check my internet connection and to look in the log file. But my internet connection is fine and there is no log file. I am running the install with Windows Defender turned off.
When I look at the start menu, none of the components except for Anaconda Prompt, are there. I would like to have Spyder and Jupyter, for example, but they are not there.
If I install the 32-bit version, it works fine. But I need the 64-bit version
Similar issue here. For easy VS code installation with 64-bit anaconda version, you can follow this way:
Install ananconda navigator typing this on shell:
conda install -c anaconda anaconda-navigator
Open anaconda navigator:
anaconda-navigator
It opens a GUI anaconda interface. You can install VS Code from here, only click Install:
It stays Installing dependencies for me all the time, but after reboot, appears installed and works properly.
Hope it helps. It would be interesting to know how to obtain this with conda commands avoiding navigator installation.
I simply close the navigator and open Anaconda Navigator as Run as administrator
and my problem solved.

Why does '(base)' appear in my anaconda command prompt?

My anaconda command prompt now says:
(base) C:\users\user_name>
I would like to know why (base) appears in front of the prompt. This started appearing since I created a virtual environment to run Django. If I enter 'deactivate' the prompt disappears but if I close the terminal and open a new terminal the 'base' is back again.
(base) C:\users\user_name> deactivate
C:\users\user_name>
The trouble is that this prompt does not recognize pip or any anaconda commands. I can run pip on the 'base' prompt, but not on the original one. I installed a module in '(base)...' using pip but this module is recognized by my ide.
conda list anaconda
in '(base)..' gives th version of Anaconda as 4.4. without the base, it does not recognize conda. I have run pip and conda several times before this happened. I'm running Windows 10.
Try this:
conda config --set auto_activate_base false
The changeps1 only hide the command prompt, you still in this environment.
auto_activate_base can avoid entering the environment.
Although Blockchain Business's answer is correct, as of v 4.6.4
DeprecationWarning: 'source deactivate' is deprecated. Use 'conda deactivate'.
so,
conda deactivate
This actually deactivates Anaconda completely, so may not be the best solution...
To restore:
conda activate
Change command prompt (changeps1) in ~/.condarc:
changeps1: False
Reference:
how to modify conda 'source activate' ps1 behavior
Document:
https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#change-command-prompt-changeps1
"(base)" is displayed to tell you which environment you are in. "base" is the default environment.
You can create a new environment from within Anaconda Navigator. You might do this to run a different version of python, perhaps, for example, because a library you wish to use is only compatible with python 3.6 or lower.
Also if you want to install an experimental library/package and not have it break your other installed packages, you might install it in a new environment, where it is isolated from the rest of your installed libraries/packages.
You are probably best to use the Environments tab in Anaconda Navigator for the creation, management of environments and installation of libraries/packages, but you can use the Anaconda Prompt commands if you like and on some machines it is a lot faster to do so.
Be aware that although pip install and conda install commands are supposed to play better together these days, I would still recommend sticking to conda install and only using pip if conda install won’t work for a particular package. This is because installing python packages so they do not conflict with one another is apparently not so trivial - and using two different package managers could be a problem. In the old days pip was almost certain to break environments that had been set up with conda or Anaconda Navigator.
If you face the issue in Ubuntu you can try the below two steps to remove it from your command prompt.
conda config
conda config --set changeps1 False
I had the same issue, I typed the following command to remove the (base) reference:
source deactivate
In my case, I had run source ~/anaconda3/etc/profile.d/conda.sh and expected the env to get activate.
Instead it must be conda activate
type 'conda deactivate' in the working terminal.
It sounds like when you installed Anaconda, it's now seeing that as your default environment, and with Anaconda it's best that you install packages using conda rather than by using pip, because at best pip installed packages won't be recognized by Anaconda, and at worst the pip installed packages can break your Anaconda install. I went through some of this before myself, as I needed to use Anaconda for a Python course I was taking, however I use Kubuntu, so I don't have a lot of knowledge around using it on Windows.
For more info on using Anaconda, see https://conda.io/docs/user-guide/getting-started.html You can probably use Anaconda Navigator to create virtual environments and install packages too.
Showing the active environment in front of the path like (base) C:\users\user_name> is a feature, not a bug. If you pip-install a module into the base environment (bad practice warning: Use conda install this_module -c conda-forge or pip install this_module into a separate environment), you'll first need to activate the base environment before you can actually use this_module. If you don't know how to do this in your IDE (although this a base functionallity of any IDE), open a cmd shell, type conda activate and then start your IDE directly from the (base) C:\users\user_name> prompt.

Anaconda (Windows) alternative to nano?

So I've been following this tutorial to download Keras with a Tensorflow backend:
https://github.com/antoniosehk/keras-tensorflow-windows-installation
It has gone fairly smoothly, and I'm only stuck for a stupid reason on the final step. It asks me to run mnist_mlp.py to test if it is working, but I don't have that file downloaded. I figured I could just type 'nano mnist_mlp.py' and then copy over the code for the file and then run it, as I would do in Linux. However, since I am on windows, it is telling me in the Anaconda prompt that nano is not a recognized command.
So, how can I create a python file in Anaconda? I've tried looking it up several times, but nothing helpful has come up. Perhaps I am asking the wrong question, for I am quite new to python. Thank you!
You can use nano from the Anaconda prompt on Windows as long as the Anaconda prompt can locate the executable file in your file system.
Installing Git on Windows will often give you a version of nano that the Anaconda prompt can locate. If you don't want Git, you can also install nano from the conda-forge channel using conda:
conda install --channel conda-forge nano
Installing nano with conda should ensure that the Anaconda prompt can locate it.

Categories