I have been trying to install 'Keras' library from Anaconda on my laptop. I have the latest version of Anaconda. After that, I tried
conda update conda
conda update --all
The above two succeeds. After that I tried
conda install -c conda-forge keras
conda install keras
Both of the above fails with the below error.
ERROR conda.core.link:_execute(502): An error occurred while installing package >'::automat-0.7.0-py_1'.
CondaError: Cannot link a source that does not exist. >C:\Users\Anaconda3\Scripts\conda.exe
I downloaded "automat-0.7.0-py_1" from anaconda site into one local folder and tried conda install from there. It works. However when I try to install Keras again, that again fails. I am clueless now what to do.
I had the same issue, and I solved using:
conda update -n base conda
Or, if conda <=4.3:
conda update -n root conda
I see that other users solved with
conda config --add pinned_packages defaults::conda
and
conda clean --all --yes
But it didn't work for me.
I guess the issue is that tensorflow is not yet released for Python3.7 (you have mentioned latest version of Anaconda). To overcome this, you may create a new environment with Python3.6 and simultaneously install Keras.
conda create -n p360 python=3.6 anaconda tensorflow keras
Here p360 is the name of the environment I chose.
Related
I had some problems with anaconda, so I decided to uninstall and reinstall it.
To do that I used anaconda-clean and ran the following command:
rm -rf ~/opt/anaconda3
The version that was installed is 4.12.0 and I wanted to update to the most recent, 22.9.0, but whenever I run
conda update conda
or
conda update -n base conda
and check the version
conda --version
I keep getting 4.12.0
Is there a way to solve this or find out if something went wrong when I deleted/installed anaconda?
Thanks!
Lu
Running conda update conda will make a best-effort attempt to update your environment. Unfortunately, you may have packages installed that prevents the update.
You can alternatively try a more explicit install:
conda install -n base conda=22.9.0
If this still fails please open an issue at https://github.com/conda/conda so the conda team can help debug further.
You likely have an old version of python in your base env with dependancies preventing automatic python update.
Running conda update python may solve this problem.
alternatively, you can install a specific version of python explicitly e.g.,
conda install python=3.9
How to install geopandas, I really tried everything and I still has error: ModuleNotFoundError: No module named 'geopandas'. I have the latest version of Python 3.9.6. I use Windows 10, I use Anaconda Prompt, I have only one version of Python.
I do not want to create other environment, I want to install it as any other package, how to do it? I tried:
pip install geopandas
conda install --channel conda-forge geopandas
!conda install geopandas
I checked also this page: https://geopandas.readthedocs.io/en/latest/getting_started/install.html to find solution but I still do not have this package. But package folium was installed correctly by pip install folium.
Help me because I try to do in second day in a row ;/
I will transcribe here the solution I found; all glory goes to Mr. Tanish Gupta, long life to him. Source here :). I hope it helps!
I did this in my win10 PC, I have Anaconda 2.1.4 and only the Python version which comes with it (3.7 I believe). I use Anaconda Prompt, I have only that one version of Python ('cause I had the latest Py ver, but outside Anaconda, and tried this. It worked, but for that 3.10 Python version, not for the Jupyter Py ver, if that makes sense).
To my understanding, probably there is some incompatibility between the libraries installed in the base environment, so we'll be creating a new one.
In the Anaconda command prompt, create a new environment variable:
conda create -n geo_env
Activate this environment “geo_env”, then add and set conda-forge channel:
conda create -n geo_env
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
Install Geopandas in the environment just created:
conda install geopandas
Next install Jupyter notebook in this environment:
conda install jupyter notebook
Note: If the above command doesn’t work for you, try conda install notebook.
Now add our environment to Jupyter notebook:
python -m ipykernel install --name geo_env
Change to our new environment in the AnacondaNavigator. Enjoy :D
In my case, then I had issues with seaborn and wordcloud in this environment, so I tried installing C++, 'cause it said in the error output, you know, I just wanted more headaches (it didn't work). Finally I installed them in the same way explained before and everything ran smoothly.
If I'm not mistaken you're either having a conflict between channels or you forgot to install geopandas packages when doing it with pip.
First of all, in an anaconda prompt, start by cleaning your environment by removing the packages that got installed by pip.
To do so just pip uninstall geopandas fiona pyproj rtree shapely.
Once you're done with that, run a conda install --channel conda-forge geopandas (normally should work).
I installed snorkel using conda and when I try to run - from snorkel.labeling import labeling_function it throws the following error - ModuleNotFoundError: No module named 'snorkel.labeling'.
I tried looking up for a solution on Github, but unfortunately, I couldn't follow through. I have also tried installing nb_conda_kernels, to make all your conda environments available in jupyterbut it didn't help. Also tried creating a separate env, installing snorkel and launching jupyter notebook from the snorkel's environment, and it didn't work either. Any form of help is much appreciated!
Thanks in advance!
Try these install instructions:
conda create --yes -n snorkel
conda activate snorkel
conda install pytorch==1.1.0 -c pytorch
conda install snorkel==0.9.0 -c conda-forge
Or these, listed here:
# [OPTIONAL] Activate a virtual environment
conda create --yes -n spam python=3.6
conda activate spam
# Install requirements (both shared and tutorial-specific)
pip install environment_kernels
# We specify PyTorch here to ensure compatibility, but it may not be necessary.
conda install pytorch==1.1.0 -c pytorch
conda install snorkel==0.9.5 -c conda-forge
pip install -r spam/requirements.txt
# Launch the Jupyter notebook interface
jupyter notebook spam
Please try the following:
For pip users
pip install snorkel
For conda users
conda install snorkel -c conda-forge
I have install py-xgboost from anaconda using:
conda install py-xgboost
where it is shown up when I run
conda list
conda env export
But from pip it doesnt show up:
pip freeze
Is there a way to make pip able to 'see' xg-boost that is installed from a conda package? The reason I need this is because I need speedml which has a dependency on xg-boost and speedml is only available to me from pip (the enterprise anaconda repo do not have speedml).
Thanks!!
This can actually be solved by using
--no-deps
as described in this SO question
So for example what I need is speedml but it requires xgboost then I create the conda environment, installed py-xgboostm, and run the following in same conda env.:
pip install speedml --no-dependencies
And afterwards speedml works!
I want to run keras on anaconda for convolution neural network using mnist handwriting recognition. A day before everything worked fine but as I try to run the same program, i get the following error in the first line:
from keras.datasets import mnist (first line of code)
ModuleNotFoundError: No module named 'keras.datasets'; 'keras' is not
a package
I also created virtual environment to use python 3.5 as my python version is 3.6. I have installed both keras and tensorflow. How do i fix the above error? Perhaps it is related to path and not error with keras. My anaconda is installed in E: whearas working environment is C:\Users\Prashant Mahato.
Do you get an error message if you just import keras? I was getting a similar error in the command line and then implemented in Spyder (using Anaconda) and it worked fine.
Here is how I install Keras and other related dependencies
conda create -n <Environment_Name> python=3.6
activate <Environment_Name>
conda update --all
conda install mingw libpython
conda install scipy
conda install numpy
conda install mkl
conda install -c conda-forge tensorflow
conda install theano
pip install pyyaml
pip install h5py
pip install keras
conda install -c conda-forge tmux
conda install pandas
condas install pillow
conda install scikit-learn
conda install -c menpo opencv3
To check if everything is work as it should just import all the packages in python within the environment created.
I'm running Windows 10 and Anaconda 4.2
If running Ubuntu, replace
activate <Environment_Name>
with
source activate <Environment_Name>
HTH.