Anaconda conda env create -f tfdl_env.yml (solving envirnoment: failed) - python

I'm currently starting udemy's Guide to tensoflow course. And it's required to type 'conda env create -f tfdl_env.yml' on the command line after using cd to get to the unziped file 'Tensorflow-Bootcamp-master'.
But after doing so this poped off: 'Solving environment: failed' (I'm on windows btw and have just installed anaconda)
I've been searching for solutions but didn't find anyhting. Is there a solution to this problem?
link to the picture of the command line

Solving environment can sometimes failed in conda, that is why, especially for machine learning libraries (I use it for everything though). Try to install every package using
conda install -c packagename conda-forge
That may take some time, but for me it was usually the solution
Sorry there may be some confusion.
Create environment of the name you want, without any specific packages
Activate environment conda activate env_name
Install all packages using forge

Related

Problem after install rospy through conda

I met a problem when I try to install rospy through conda. First, I use command "conda activate mujoco_py" to activate a specific environment I usually use. Then I input the command " conda install -c conda-forge ros-rospy ". Then after I finish installing the rospy, I input the command "env |grep ROS", it shows as below:
ROS_VERSION=1
ROS_PYTHON_VERSION=3.8
ROS_PACKAGE_PATH=/home/shine/anaconda3/envs/mujoco_py/share
ROSLISP_PACKAGE_DIRECTORIES=/home/shine/catkin_final/devel/share/common-lisp:/home/shine/catkin_ws/devel/share/common-lisp
ROS_IP=192.168.1.7
ROS_ETC_DIR=/home/shine/anaconda3/envs/mujoco_py/etc/ros
ROS_MASTER_URI=http://192.168.1.7:11311/
ROS_ROOT=/home/shine/anaconda3/envs/mujoco_py/share/ros
ROS_DISTRO=melodic
My Ubuntu system is ubuntu 20 and install ROS noetic. Does anyone know how to deal with the problem of that? I would like to use ros in my specific conda environment and also without conda it can be also run. I try to use the command "conda uninstall ros-rospy" to uninstall it from my conda environment, but I failed.
Oh! I dealt with the problem with the command "conda uninstall ros-rospy" with three times. Sometimes you need to try several times due to the speed of the internet or your personal device situation.

Problems installing python packages on Mac M1

I want to install python packages listed in the requirements file of my github repo. However, I have problems installing those python packages into my conda environment.
First of all, I installed conda with Miniforge3-MacOSX-arm64 which supports the M1 with arm64 architecture. However, some specific python packages like onnxruntime I wasn't able to install, because I encountered error messages like that:
ERROR: Could not find a version that satisfies the requirement onnxruntime
ERROR: No matching distribution found for onnxruntime
I assumed that for those specific python packages there is no support yet for the M1.
Therefore, I pursued another approach. I set the settings of Terminal to "Open with Rosetta". The plan is to install the applications of the intel x86_64 architecture and let Rossetta create the binaries to let run on arm64. Then I uninstalled miniforge for arm64 and installed miniforge for x86_64 named Miniforge3-MacOSX-x86_64. With that setup I was able to install all listed python packages of the requirement file and with pip freeze I can also confirm that they have been installed. However, I am somehow not able to use those python packages. For instance if I want to run pytest I get the following error:
zsh: illegal hardware instruction pytest
I assumed Rossetta takes care of that, that I can use applications for x86_64 also on arm64. But somehow it doesn't work. I tried a lot of different things and am out of ideas.
Does anyone know what the problem is? I would be also thankful for advice and suggestions how to properly set up a python environment on Mac M1.
I had the same problem back in 2days ago, I'm using m1 pro. I was trying to install the python packages only using pip but I got a numbers of errors, then I decided to install with conda.
In my case it worked, here is what I've done so far is:
First Enable the open with rosetta in your zsh.
And then,
# create environment in conda
conda create -n venv python=3.8 # with your python version
# activate
conda activate venv
and visit the conda website to look for the packages:
check packages
For suppose if you are looking for pytest packages then you can search it, and you'll get a result like this, with the available package and channel.
You need to enable that specific channel to get that package with this command:
# config channel
conda config --append channels conda-forge # available channel name
# then install
conda install --yes --file requirements.txt
Make sure, your have the same version of pytest in your requirements.txt file. (eg:pytest==6.2.5)
Hope this should work, if not try to install it with pip like:
pip install -r requirements.txt
after environment enable.

Unable to Install FB Prophet Using Conda (Mac OS)

I am trying to install FB's Prophet package to use in Jupyter, which I launch via Anaconda, however I am getting errors with each attempt. I started on FB's Git page and used 'conda install -c conda-forge prophet', however, I continuously get an error that I need to manually a series of files (hijri, ephem, lunarcalendar, etc.). I have researched as many links as I could, including this long exchange on GitHub, but have been unable to find a solution. In my more recent attempts to install Prophet I am just getting a continuous loop of "Solving environment".
I am a relatively new user to Anaconda and not intimately familiar with interacting in Terminal. If anyone can offer insights into what I could be doing differently it would be greatly appreciated.
Please let me know if I can provide any more details. Thank you.
It's always best to create a new environment rather than installing new packages into the base environment - the base env already contains lots of packages so you are liable to hit lots of dependency problems if you introduce anything new as conda tries to figure out what version of every package will be compatible with all the others.
To create a new env called myenv in which you want to use the packages prophet and jupyter (and all their dependencies), and getting the packages from the conda-forge channel, do:
conda create -n myenv -c conda-forge prophet jupyter
To use Jupyter in this environment, just activate the env before starting Jupyter:
conda activate myenv
jupyter notebook
For more information about working with conda environments, see the documentation

What is the best way to Install Conda on MacOS (Apple/Mac)?

What is the recommended approach for installing Anaconda on Mac?
I tried with brew cask install anaconda which after a while returns anaconda was successfully installed!.
After that - trying conda command returns command not found: conda.
Is there any post step installation that needs to be done?
And what is recommended way to install Conda on MacOS?
brew install anaconda
export PATH="/usr/local/anaconda3/bin:$PATH"
I would say that the recommended way to install anaconda is to use the official anaconda installer, which can be downloaded from the link I just posted. I've done it several times, never had a problem, and it walks you through it (including an option to automatically add it to your PATH).
New answer using only the terminal for mac zsh
This is how I did it only using the terminal and apple's now default zsh:
# - install python
# install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# install wget to get miniconda
brew install wget
# get miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
# source /Users/my_username/opt/anaconda3/bin/activate
source ~/miniconda/bin/activate
conda init zsh
conda update -n base -c defaults conda
conda install conda-build
conda create -n iit_synthesis python=3.9
conda activate iit_synthesis
#conda remove --name metalearning2 --all
inspired from: How do I use Conda in on Homebrew Python system?
Old answer
I don't know about other people but I've had issue downloading conda/miniconda etc for a few hours now. For some reason it decided to install at ~/opt when using the graphical installer (i.e. the .dmg file). I've been through the uninstall here How to uninstall Anaconda completely from macOS and additionall did an rm -rf ~/opt command. Seems that without this its not actually uninstalled (you might also have to change your PATH or .bash_profile or .bashrc until your path is virigin again before you start your re-installation installation). Seems that using the command line installer is what works:
Anaconda3 will now be installed into this location:
/Users/brandBrandoParetoopareto/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/Users/brandBrandoParetoopareto/anaconda3] >>>
PREFIX=/Users/brandBrandoParetoopareto/anaconda3
Unpacking payload ...
Collecting package metadata (current_repodata.json): done
Solving environment: done
So for that download it from the official link then do:
sh Anaconda3-2020.02-MacOSX-x86_64.sh
do sh I believe is the right thing because I might have had issue in the past when I did bash instead...plus if you are using a different shell like zsh I am not sure what you'd need to do, but I'd get sh would be safest.
After the installation is done you should do:
conda init <SHELL-NAME>
so that conda is initialized correctly (so far that seems to only modify my .bash_profile and my PATH variable). Unfortunately, it seems the previous uninstallation attempts didn't remove the code the previous conda init had added from my .bash_profile so I removed it manually using vim.
This is what I get after doing that:
conda init bash
no change /Users/brandBrandoParetoopareto/anaconda3/condabin/conda
no change /Users/brandBrandoParetoopareto/anaconda3/bin/conda
no change /Users/brandBrandoParetoopareto/anaconda3/bin/conda-env
no change /Users/brandBrandoParetoopareto/anaconda3/bin/activate
no change /Users/brandBrandoParetoopareto/anaconda3/bin/deactivate
no change /Users/brandBrandoParetoopareto/anaconda3/etc/profile.d/conda.sh
no change /Users/brandBrandoParetoopareto/anaconda3/etc/fish/conf.d/conda.fish
no change /Users/brandBrandoParetoopareto/anaconda3/shell/condabin/Conda.psm1
no change /Users/brandBrandoParetoopareto/anaconda3/shell/condabin/conda-hook.ps1
no change /Users/brandBrandoParetoopareto/anaconda3/lib/python3.7/site-packages/xontrib/conda.xsh
no change /Users/brandBrandoParetoopareto/anaconda3/etc/profile.d/conda.csh
modified /Users/brandBrandoParetoopareto/.bash_profile
==> For changes to take effect, close and re-open your current shell. <==
if you are using vs-code integrated terminal like I am you need to press the trash can button. Doing bash seems to NOT re-run your .bash_profile so make sure you do what it would consider "closing your terminal and re-opening it completely".
That should be all you need to do I believe. Perhaps you also need to make sure you have the most recent version of mac OS.
Extra tips hints
Make sure conda init modified your .bash_profile correctly. For me for some reason it added it's stuff AFTER it ran my .bashrc and thus when my .bashrc tried activating my environment it wouldn't do it as it would say conda wasn't initialized correctly (and thus nio matter how many times I re-ran conda init <SHELL> it wouldn't fix it. I don't know why that happened but that's how it was.
I avoided the dmg/graphical installation since it seemed to install it at non-standard places ~/opt
If conda is still acting weird it might be because of the way your .bashrc modifies the PATH env variable. What worked for me was removing lines that modified my path in .bashrc (AND having the code conda init added before my .bashrc was ran).
inspired from:
https://askubuntu.com/questions/505919/how-to-install-anaconda-on-ubuntu/1412558#1412558
https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html
mac provides the nice renaming and downloading to location: https://docs.conda.io/projects/conda/en/latest/user-guide/install/macos.html
How to install wget in macOS?
After installation using the graphical installation, everything sits in the ~/opt directory, as mentioned in some previous answers. If this is OK for you, all you need to do to use the command line conda is add ~/opt/anaconda3/bin in your path. This can be done by adding
export PATH="${PATH}:~/opt/anaconda3/bin"
at the end of your rc file (~/.zshrc or ~/.bashrc).

Conda is corrupted after pip install conda

My conda is corrupted after I run command "pip install conda". Is there any way to recover it ? Thanks
Here's the error I see when running conda command
ERROR: The install method you used for conda--probably either `pip install conda`
or `easy_install conda`--is not compatible with using conda as an application.
If your intention is to install conda as a standalone application, currently
supported install methods include the Anaconda installer and the miniconda
installer. You can download the miniconda installer from
https://conda.io/miniconda.html.
Simply, follow the instructions given in the error:
Download miniconda, then run the script file by typing following command: bash <file_name.sh> e.g.
bash Miniconda3-latest-Linux-x86_64.sh.
Now reopen the terminal for the changes to take effect.
If conda is already installed on your system, you can reinstall it with the -f force option, for example,
bash Miniconda3-latest-Linux-x86_64.sh -f
To test your installation, enter the command conda --version. If installed correctly, you will see the version of conda installed.
miniconda: https://conda.io/en/latest/miniconda.html
conda troubleshooting: https://conda.io/docs/troubleshooting.html
If you are facing this problem in Virtual Machine (VM) then you have to activate the main environment by running below line of code:
source /anaconda_installation_folder_path/bin/activate
Once you are in your main environment you can work with conda.
TL;DR: nothing is corrupted, the message you're seeing is a hardcoded stub and could be fixed.
conda package manager actually can be used with regular python installation.
Update: I've been tinkering with the described method and found that you should use conda install --dry-run ... to see changes that are going to happen. Some conda packages depend on other python version, which would overwrite the installed one. There's might be a solution for this with changing conda channels or using virtualenv. I also found that --dry-run doesn't work when using local package archives.
I'll show you how to run cudatoolkit 9.1 without any Anaconda and python-3.6-amd64. I'm using cuda 9.1 from here.
Since conda is artificially tethered with Anaconda, you have to untie them.
I recommend you to backup up python installation directory you'll be working with (or use virtualenv).
Install menuinst dependency.
At the moment, it's broken from PyPi, so get if from
github. Build it and install python setup.py install
This package is problematic also in Anaconda distribution. It triggers series of requests for admin rights every time, which should be suppressed with conda ... --no-shortcuts option.
pip install pypiwin32, dependency of (1)
pip install conda, requires (1)
Move to python installation directory. ./Scripts/conda.exe should exist.
Move to ./Lib/site-packages/conda
Search directory recursively for pip_warning substring in following TEXT file types: .py, .json, .txt
Replace matching substrings pip_warning with main
Don't forget to abide the syntax of file types you'd be editing.
Now open the ./Scripts/conda.exe executable in any hex-editor and
find pip_warning, carefully overwrite it with main and wipe the
rest with spaces until bytes import main
Check for file size not have changed.
Remove any __pycache__ dirs if found in ./Lib/site-packages/conda
If you only need working conda without cuda, you're done here.
Run conda install mkl, pip install llvmlite numpy
Download packages cudatoolkit-9.1-0.tar.bz2
and numba-0.36.2.tar.bz2
and run
conda install cudatoolkit-9.1-0.tar.bz2
conda install numba-0.36.2-***.tar.bz2
Wait a little while unpacking finished.
Now try these examples, they should work and your gpu monitor show some activity. conda ... commands also do work.
With Linux, I guess instructions are the same, just would be .sh or ELF in place of .exe.
In my case, what worked was:
pip uninstall conda
and then installing miniconda
Download miniconda, then run the script file by typing following command: bash <file_name.sh> e.g. bash Miniconda3-latest-Linux-x86_64.sh -u
'-u' : update tag, used if the original conda bash paths get lost due to certain modifications in the .bashrc file

Categories

Resources