Problem with Anaconda Uninstall/Install (MacOS) - python

I accidentally deleted Anaconda app by removing it into the bin (and I emptied it). And I redownloaded the anaconda3 pkg in an attempt to reinstall the application but it doesn't allow me to reinstall stating that Anaconda3 is already in /opt/anaconda3. And I am not sure what I can do to reinstall it.
Does anyone know what I can do?
I also downloaded the anaconda clean package using Terminal and all, but it doesn't seem to work still. Would appreciate any help.

In your terminal type
nano ~/.bash_profile
Scroll to the bottom of the page and add
export PATH=/usr/local/anaconda3/bin:$PATH
Press ctrl+x and hit Enter to confirm then run this command
source ~/.bash_profile
and then this one
conda install anaconda-navigator

Related

Issue connecting to the Kernel in Jupyter notebook

I have just installed my Jupyter notebook to run Python . I have an active internet connection and python installed . I am getting an error saying "A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration."
The error is shown in the figure below
I tried running "conda info" on my terminal. This is what I got.
This is the output of my Jupyter notebook terminal
I tried reading many solutions on internet but it did not work .Can u please help me out?.
I think you may have too many variables affecting your install to be able to determine exactly what is wrong. I would recommend starting with a fresh install of Python use either 3.10.8 or 3.11.0:
https://www.python.org/ftp/python/3.10.8/python-3.10.8-amd64.exe
https://www.python.org/ftp/python/3.11.0/python-3.11.0-amd64.exe
Make sure you check the box for adding python.exe to PATH on the first step of the installer.
Check that the newly installed version is the correct one in your PATH:
c:\>python -V
If the version shown is different than the one you just installed, go look at your environemnt variables and make sure that your PATH is correct: the new install should be earlier in the PATH than other Python installs (or remove the others from PATH completely).
Then create an empty virtual environment from that Python install:
c:\>python -m venv c:\path\to\myenv
https://docs.python.org/3/library/venv.html#creating-virtual-environments
Then activate the fresh virtual environment:
C:\> c:\path\to\myenv\Scripts\activate.bat
Now install JupyterLab
pip install wheel jupyterlab
Finally, run JupyterLab:
jupyter lab
This should open the browser automagically. If you are still having problems, you have narrowed the number of variables because this is a clean basic install with nothing except for JupyterLab and nothing else. However, you may still have some configuration from a previous install. If you were working in that previous install and may have some valuable configuration settings, change the name of these directories to keep a copy of the old one to sort through on your own later: %PROGRAMDATA%\jupyter and %APPDATA%\jupyter. Or, if you have never gotten the previous install working at all, just delete these directories altogether. The next time you start Jupyter, they will be created fresh.

Anaconda prompt closes automatically

screenshot of prompt before it closes
the anaconda prompt closes automatically not sure why.
pic of anaconda files after install
files installed
I installed the anaconda distrubtion https://www.anaconda.com/distribution/#download-section from here version 3.7. I cannot find anaconda app, spyder or jupyter notebook app. I only see files named after them. I tryed uninstalling but to clean out anaconda and properly install again i have been told to remove files left behind when using normal uninstall. So Is there a way to run anaconda clean without anaconda prompt? https://github.com/ContinuumIO/anaconda-clean. Im a newb at coding .
Edit: i cannot type anything into the prompt it shows me the picture above before quickly closing.

Pandas and Jupyter not found after upgrading to Catalina

I just updated my macOS to Catalina and I can't run python or open a jupyter notebook from terminal anymore. As an example, I get error message "ImportError: No module named pandas" when running my python code, and I get
zsh: command not found: jupyter
when running
jupyter notebook
This issue has brought me to anaconda (I would love someone to explain me why. Does python need anaconda to be ran?). I have tried several suggestions from https://github.com/ContinuumIO/anaconda-issues/issues/10998, e.g. I have tried copying folder "anaconda3" from "Relocated items" folder to "Users//", then
export PATH=''/Users/<username>/anaconda3/bin:$PATH"
but I get either
dquote>
or
zsh: /Users//Applications/anaconda3/bin/conda: bad interpreter: /anaconda3/bin/python: no such file or directory
I then tried to reinstall Anaconda using the graphic installer (from https://www.anaconda.com/distribution/#macos) following advice from someone from the anaconda team (https://www.anaconda.com/how-to-restore-anaconda-after-macos-catalina-update/) (I changed installation location to a folder I created in /Users//) but I still get the same error messages when running python3 or jupyter notebook.
How can successfully run python and jupyter notebook with macOS Catalina?
After installed macOS Catalina, we can switch the terminal from bash to zsh. There are many advantages from using zsh instead of bash, but One of the issues with zsh is some of the frameworks (jupyter notebook,conda) are not supported directly. Once I typed jupyter notebook in terminal to run it. It displayed “zsh: no such file or directory”.
The solver is simple but very difficult to find online.
If jupyter was already installed before the update and stopped working after zsh, you should be able to fix it by:
1.open zshrc in terminal by typing: open .zshrc or $open .zschrc
2. add the following line at the end of the file:
source ~/.bash_profile
It will ask zsh to use all the information from bash like the path of jupyter.
Hope it can help you out!
I'm answering to my own question in case it can help others ;)
I found my answer here: https://medium.com/#singhaniatanay18/mac-os-catalina-update-zsh-instead-of-bash-d688f68f70b8
(see comments as well)
Mac OS BigSur:
Uninstall Anaconda:rm -f Anaconda-Navigator.app
re-install pip3 install jupyterlab
I just updated to Catalina, two days before Big Sur release.. oh well.
Catalina came with changes to security and bash, that will remain for future releases. So Catalina moves your anaconda3 folder to /Users/Shared/Previously Relocated Items/Security/anaconda3 I tried to move it back to home directory, but that didn't work. So I deleted it, and reinstalled Anaconda using the command line installer Not the GUI installer, and it worked for me. You can follow instructions here and use /Users/me/anaconda3 folder as recommended here.
Here are the commands that worked for me,
shasum -a 256 /Users/username/anaconda3 . Although not sure it did anything
bash ~/Downloads/Anaconda3-2020.02-MacOSX-x86_64.sh or whatever the name of the command line installer from Conda in your Download folder, or wherever else you downloaded it.
Use sudo in front of the command if permission was denied, then enter your log in password for your Mac
source /Users/username/anaconda3/bin/activate conda init zsh
sudo conda init zsh then enter your Mac's password.
You should be all set now, and all commands like ipython, conda info, jupyter notebook, pyspark will all work.
The last command will make step3 command persist i.e. initialize conda base environment, such that you can run conda, ipython, jupyter notebook the next time you use terminal.
Install the Jupyter using Homebrew in zsh shell
If you don't Python install 3.3or higher.
Open terminal
Using Homewbrew install jupyter
brew install jupyter
Now, you start a notebook
jupyter notebook

Anaconda Installed but Cannot Launch Navigator

Anaconda (listed as "Python 3.6.0 (Anaconda 4.3.1 64 bit)" ) is in my programs and features list, but there is seeming no Anaconda Navigator desktop app, as their seems to be no icon on my desktop and I am unable to search for it through "Start". Could this be because I have the 32-bit version of Anaconda downloaded and I have a 64-bit OS (I thought I should do this because Python on my computer was 64-bit) or because I downloaded Anaconda under "users" instead of Desktop. I also downloaded Anaconda twice, if that could be causing some of the problem. I have a Windows 10 laptop, if that is any help.
Try to
source ~/anaconda3/bin/activate root
anaconda-navigator
https://github.com/ContinuumIO/anaconda-issues/issues/1580
Open up a command terminal (CTRL+ALT+T)
and try running this command:
anaconda-navigator
When I installed Anaconda, and read the website docs, they said that they tend to not add a file or menu path to run the navigator because there are so many different versions of different systems, instead they give the above terminal command to start the navigator GUI and advise on setting up a shortcut to do this process manually - if that works for you it shouldn't be too much trouble to do it this way - I do it like this personally
How I solved this issue:
1. Be connected to the internet.
2. Open the Anaconda Prompt (looks like a regular command window).
If you installed the .exe in your /name/user/ location you should be fine, if not navigate to it.
Then start an environment.
conda info --envs
Then run
conda install -c anaconda anaconda-navigator
Press y when prompted (if prompted). It will being downloading the packages needed.
Then run your newly installed Anaconda Navigator
anaconda-navigator
It should start, and also appear in your regular windows 10 apps list.
activate the virtual env with command:
conda activate base
run anacond anavigator
anaconda-navigator
when you will type anaconda in windows 10 search bar it will give you the list as
then in terminal you have to type anaconda-navigator as
it will start anaconda on your machine.
Yet another option which worked in my case on Windows 10: Try uninstalling your previous installation, restart the system and run the installation again. Make sure you don't start any programs before installing Anaconda. You will find the installation finishes without prompting any kind of errors.
Type in Anaconda in your Windows 10 Search bar. You will find Anaconda Prompt appear.
I figured out the reason as to why:
1-There seems to be no navigator icon
2-When conducting the above steps of running the "anaconda-navigator" command in prompt (whether cmd or Anaconda) it yields "anaconda navigator is not recognized as an internal or external command"
This was very frustrating to me as I'd installed the proper version multiple times with no avail.
To solve this problem :
in the installation process, there will be an advanced options step with 2 selections one of which is unchecked (the top one). Make sure you check it which will add the navigator to the path of your machine variables.
Cheers,
Hossam
it works :
export PATH=/home/yourUserName/anaconda3/bin:$PATH
after that run anaconda-navigator command. remember anaconda can't in Sudo mode, so don't use sudo at all.
I faced the same problem on Windows 10. As soon as I cleared my Path variable from edit environment variables option, the icon started to appear. It was occurring because I had previously installed python 3.6.1 on my computer and added it to my path variable as C:\Python36;C:\Python36\DLL; and so on. There isn't any need to uninstall Anaconda Navigator and start from scratch if you have correctly followed the steps mentioned at the documentation for it.
Try restarting the system! You will be able to find the navigator once you restart the system after installation.
Tried all solutions here but these 2 steps solved the issue:
1) manual update of open-ssl from here:
https://slproweb.com/products/Win32OpenSSL.html
2) update OpenSSL using conda update openssl command in the Anaconda Prompt
solved the issue!
I had a similar issue today where only the prompt was available after installation.
Finally solved this by un-installing my regular python installation and then install anaconda(anaconda 3 v5.2.0, with python 3.6).
I also have the issue on windows when i am unable to find the anaconda-navigator in start menu.
First you have to check anaconda-navigator.exe file in your anaconda folder if this file is present it means you have installed it properly otherwise there is some problem and you have to reinstall it.
Before reinstalling this points to be noticed
1) You have to uninstall all previous python folder
2) Check you environment variable and clear all previous python path
After this install anaconda
your problem will be resolved if not tell me the full error i will try to solve it
Uninstall your Anaconda, delete the folder where it was. Then reinstall it.
You might not be in a anaconda environment
Below is a link how to activate the environment from the official documentation
On Windows, in your Anaconda Prompt, run activate myenv
https://conda.io/docs/user-guide/tasks/manage-environments.html#activating-an-environment
And then run the anaconda navigator from the anaconda prompt by entering the command anaconda-navigator
100% Solved.
While Installing make sure you are connected to Internet.
If already installed anaconda, open the anaconda command prompt and type following command:
conda install -c anaconda anaconda-navigator
(internet connection is required)
Note: In some cases restarting may solve the issue of navigator.
This is what I did
Reinstall anacoda with ticked first check box
Remember to Restart
I have that error an the solution was to install the Win64 OpenSSL.
https://slproweb.com/products/Win32OpenSSL.html
Download and install Miniconda first from this link and later on download and install Anaconda. Then you will be able to see the navigator in your all programs list in the start menu. I hope this will help you. Let me know in case of any concerns.
In my case; it was available in the anaconda folder in "All App" from main menu
For people from Brazil
There is a security software called Warsaw (used for home banking) that must be uninstalled! After you can install it back again.
After thousand times trying, installing, uninstalling, cleanning-up the regedit that finally solved the problem.
First Run This Command
conda config --set auto_activate_base True
Then Run This Command
anaconda-navigator.
Turn off your internet connection, then open your terminal and type anaconda-navigator or type anaconda prompt in the search bar and double click on the anaconda prompt.
If anaconda is opened, then you can turn on your Wi-Fi.
I'm also faced with this issue. When I checked conda --version got a command not recognized error. Then I set the environmental variables as in https://stackoverflow.com/a/61372328/13370201. After that run anaconda navigator command. Then it started to initializing anaconda navigator.This tutorial also help for me.
I faced the same problem in Solus Baidge but I solved by activating the conda environment.
First activate
conda activate
Then run the navigator
anaconda-navigator
Make sure to run the installer as admin
In my case (Windows 11) it was a permission problem. Make sure to run the installer as administrator. You can check this by modification of the path in the installer process.
Further steps to handle the problem:
Uninstall your actual anaconda version.
Delete old Data found in:
C:\Users\YourUsername\AppData\Roaming
C:\Users\YourUsername
(In my case it was called .anaconda and .conda folder)
Restart PC
Install Anaconda as admin
The followng command solved my issue.
pip install --upgrade pywin32==228
On windows 10, I faced the same error - only Anaconda Prompt was showing in the startup menu. What I did is i re-installed Anaconda and selected install for all users of the pc (in my initial installation I have installed only for current user).
What finally worked for me was:
Uninstalling Anaconda
Deleting all files that has "conda" in them - most of them should be
located in: C:\Users\Admin
Delete especially the "condarc" file.
Reboot
Installed 32-bit installer (even though my system is 64-bit) and reboot
Finally worked. I have not yet re-tried with 64-bit installer, since I have a time critical project, but will do when again I have spare time.
P.S. what broke Anaconda for me was a blue screen I got while updating Anaconda. I guess it did not clear all old files and this broke the new installs.
I too faced a similar issue when I was not able to find the Anaconda Navigator Desktop app in the start menu. But do not worry , Go to start Menu and Type Anaconda Navigator. Now within the apps menu you will find anaconda navigator with its icon. Click on that. After clicking you will find a command prompt dialog opened and a .exe file runs on your machine. Wait till it completes.
The Anaconda Navigator app opens on your machine.

'Conda' is not recognized as internal or external command

I installed Anaconda3 4.4.0 (32 bit) on my Windows 7 Professional machine and imported NumPy and Pandas on Jupyter notebook so I assume Python was installed correctly. But when I type conda list and conda --version in command prompt, it says conda is not recognized as internal or external command.
I have set environment variable for Anaconda3; Variable Name: Path, Variable Value: C:\Users\dipanwita.neogy\Anaconda3
How do I make it work?
I was faced with the same issue in windows 10, Updating the environment variable following steps, it's working fine.
I know It is a lengthy answer for the simple environment setups, I thought it's may be useful for the new window 10 users.
1) Open Anaconda Prompt:
2) Check Conda Installed Location.
where conda
3) Open Advanced System Settings
4) Click on Environment Variables
5) Edit Path
6) Add New Path
C:\Users\RajaRama\Anaconda3\Scripts
C:\Users\RajaRama\Anaconda3
C:\Users\RajaRama\Anaconda3\Library\bin
7) Open Command Prompt and Check Versions
8) After 7th step type
conda install anaconda-navigator in cmd then press y
Although you were offered a good solution by others I think it is helpful to point out what is really happening. As per the Anaconda 4.4 changelog, https://docs.anaconda.com/anaconda/reference/release-notes/#what-s-new-in-anaconda-4-4:
On Windows, the PATH environment variable is no longer changed by default, as this can cause trouble with other software. The recommended approach is to instead use Anaconda Navigator or the Anaconda Command Prompt (located in the Start Menu under “Anaconda”) when you wish to use Anaconda software.
(Note: recent Win 10 does not assume you have privileges to install or update. If the command fails, right-click on the Anaconda Command Prompt, choose "More", chose "Run as administrator")
This is a change from previous installations. It is suggested to use Navigator or the Anaconda Prompt although you can always add it to your PATH as well. During the install the box to add Anaconda to the PATH is now unchecked but you can select it.
I found the solution.
Variable value should be C:\Users\dipanwita.neogy\Anaconda3\Scripts
When you install anaconda on windows now, it doesn't automatically add Python or Conda to your path.
While during the installation process you can check this box, you can also add python and/or python to your path manually (as you can see below the image)
If you don’t know where your conda and/or python is, you type the following commands into your anaconda prompt
where python
where conda
Next, you can add Python and Conda to your path by using the setx command in your command prompt (replace C:\Users\mgalarnyk\Anaconda2 with the results you got when running where python and where conda).
SETX PATH "%PATH%;C:\Users\mgalarnyk\Anaconda2\Scripts;C:\Users\mgalarnyk\Anaconda2"
Next close that command prompt and open a new one. Congrats you can now use conda and python
Source: https://medium.com/#GalarnykMichael/install-python-on-windows-anaconda-c63c7c3d1444
Just to be clear, you need to go to the controlpanel\System\Advanced system settings\Environment Variables\Path,
then hit edit and add:
C:Users\user.user\Anaconda3\Scripts
to the end and restart the cmd line
In addition to adding C:\Users\yourusername\Anaconda3 and C:\Users\yourusername\Anaconda3\Scripts, as recommended by Raja (above), also add C:\Users\yourusername\Anaconda3\Library\bin to your path variable. This will prevent an SSL error that is bound to happen if you're performing this on a fresh install of Anaconda.
If you have a newer version of the Anaconda Navigator, open the Anaconda Prompt program that came in the install. Type all the usual conda update/conda install commands there.
I think the answers above explain this, but I could have used a very simple instruction like this. Perhaps it will help others.
Go To anaconda prompt(type "anaconda" in search box in your laptop). type following commands
where conda
add that location to your environment path variables. Close the cmd and open it again
This problem arose for me when I installed Anaconda multiple times. I was careful to do an uninstall but there are some things that the uninstall process doesn't undo.
In my case, I needed to remove a file Microsoft.PowerShell_profile.ps1 from ~\Documents\WindowsPowerShell\. I identified that this file was the culprit by opening it in a text editor. I saw that it referenced the old installation location C:\Anaconda3\.
For conda --version greater than 4.6, from the base of your Anaconda promt, run
conda update conda
conda init
This will update your conda root environment and setup the stuff you need to run it on both cwd and powershell.
After this, you can start any terminal and it will be conda ready.
If you don't want to add Anaconda to env. path and you are using Windows try this:
Open cmd;
Type path to your folder instalation. It's something like:
C:\Users\your_home folder\Anaconda3\Scripts
Test Anaconda, for exemple type conda --version.
Update Anaconda: conda update conda or conda update --all or conda update anaconda.
Update Spyder:
conda update qt pyqt
conda update spyder
I have Windows 10 64 bit, this worked for me,
This solution can work for both (Anaconda/MiniConda) distributions.
First of all try to uninstall anaconda/miniconda which is causing problem.
After that delete '.anaconda' and '.conda' folders from 'C:\Users\'
If you have any antivirus software installed then try to exclude all the folders,subfolders inside 'C:\ProgramData\Anaconda3\' from
Behaviour detection.
Virus detection.
DNA scan.
Suspicious files scan.
Any other virus protection mode.
*(Note: 'C:\ProgramData\Anaconda3' this folder is default installation folder, you can change it just replace your excluded path at installation destination prompt while installing Anaconda)*
Now install Anaconda with admin privileges.
Set the installation path as 'C:\ProgramData\Anaconda3' or you can specify your custom path just remember it should not contain any white space and it should be excluded from virus detection.
At Advanced Installation Options you can check "Add Anaconda to my PATH environment variable(optional)" and "Register Anaconda as my default Python 3.6"
Install it with further default settings. Click on finish after done.
Restart your computer.
Now open Command prompt or Anaconda prompt and check installation using following command
conda list
If you get any package list then the anaconda/miniconda is successfully installed.
I have just launched anaconda-navigator and run the conda commands from there.
For those who didn't check "Add Anaconda to my PATH environment variable". In Windows 10 it looks like that:
5 paths:
C:\Users\shtosh\anaconda3
C:\Users\shtosh\anaconda3\Library\mingw-w64\bin
C:\Users\shtosh\anaconda3\Library\usr\bin
C:\Users\shtosh\anaconda3\Library\bin
C:\Users\shtosh\anaconda3\Scripts
if you use chocolatey, conda is in C:\tools\Anaconda3\Scripts
I had this problem in windows. Most of the answers are not as recommended by anaconda, you should not add the path to the environment variables as it can break other things. Instead you should use anaconda prompt as mentioned in the top answer.
However, this may also break. In this case right click on the shortcut, go to shortcut tab, and the target value should read something like:
%windir%\System32\cmd.exe "/K" C:\Users\myUser\Anaconda3\Scripts\activate.bat C:\Users\myUser\Anaconda3

Categories

Resources