Installation of Geopandas for Windows 10 - python

There are some problems about geopandas installation for Windows 10 system. You know that this module is including some dependencies into widerange. In this mean, I presented as snapshots my system responses with this dependencies as a summary.
What is the problem?

The error just says it cannot find the file it needs in your Environment Path. Navigate to your cmd terminal and try:
conda install geopandas
Alternatively you can grab the install and all dependencies from the forge:
conda install --channel conda-forge geopandas

It gets easy when you create new environment for it, then start installing. I had followed a lot procedure, downloading wheel files and installing manually but creating the environment and then installing (using Anaconda) make it lot easier.
I have followed this from https://geopandas.org/getting_started/install.html
enter image description here
conda create -n geo_env
conda activate geo_env
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda install python=3 geopandas

Related

conda doesn't see the nuitka package

When trying to compile a file, using the command conda -m nuitka -onefilestrict test.py
I get an error CommandNotFoundError: No command 'conda nuitka'.
Used conda config --add channels conda-forgeand conda config --set channel_priority strict before installation (conda install nuitka)
When I enter conda search nuitka - I get a lot of packages starting from the 0.5.x to 0.7.7 version.
But when I use - conda list nuitka. I get nothing
conda --version
conda 4.10.3
You seem to have never actually isntalled the package
conda search
lists all packages that you could install that match the given name
conda list
lists the currently installed packages. So you need to do
conda install nuitka

How to update flask from version 1.1.2 to version 2.0 on anaconda?

When I install the latest version of anaconda distribution, it comes with flask version 1.1.2. However, I need to install flask version 2.0. How can I install flask version 2.0 (in the base environment) while keeping other existing packages installed such as sklearn and numpy, etc.?
First do conda activate base,
Then you can either do pip install flask==2.0.0 or conda install -c conda-forge flask==2.0.0. Both are okay as long as you do conda activate base first.
You should consider creating a new environment for your project and not mess with the base environment.
First do conda create -n newname, then conda activate newname.
Then you can do conda install -c conda-forge numpy pandas sklearn flask==2.0.0, you can also do pip install numpy pandas sklearn flask==2.0.0. You can install everything you need in one line.
In a nutshell:
conda activate base
conda remove flask
conda install -c conda-forge flask
Line 1: to activate your base virtual environment
Line 2: in order to avoid any conflict, remove flask 1.1.2
line 3: install the latest flask version via the channel conda-forge (2.0.1 as for now)
If you want the 2.0.0 you should do this: conda install -c conda-forge flask=2.0.0
Explanations:
Channels:
conda uses channels (like repositories where the packages are stored). By default, the channel is the anaconda channel. So, if you installed flask with conda install flask that is the same as if you did conda install -c anaconda flask. And from this page (https://anaconda.org/anaconda/flask) you can see that the actual version on this channel is 1.1.2.
About the update part:
In general, to update all your packages in a virtual environment, you first have to activate your virtual environment with conda activate [virtual_environment_name] and then conda update --all.
But as you can see from the previous link, on the default channel (anconda), the latest version is 1.1.2, so, strictly speaking, you can't update flask to a version greater than 1.1.2.
But, because on the conda-forge channel the latest version is -as for now- 2.0.1, if you install flask from this channel, you will get flask 2.0.1.
Using pip in a Conda environment:
An other option mentionned by #anarchy too is to use pip install flask=2.0.0 but you should avoid that. See: https://www.anaconda.com/blog/using-pip-in-a-conda-environment and
Is that a bad idea to use conda and pip install on the same environment?.
About not using the base environment directly:
And in order to have a clean workspace, it's a good practice to create a virtual environment other than the base environment for your projects. You can create and then activate a new environment named for example "myenv" like this:
conda create -n myenv
conda activate myenv
And so the complete code would be:
conda create -n myenv
conda activate myenv
conda install -c conda-forge flask
And finally if you want to install the latest versions of other packages like numpy and sklearn, you should use conda-forge too:
conda install -c conda-forge scikit-learn
conda install -c conda-forge numpy

error while installing tensorflow in conda environment (CondaError: Cannot link a source that does not exist.)

trying to install tensorflow using conda package manager
using following command
conda install -c conda-forge tensorflow
but it gives following error while executing transaction
CondaError: Cannot link a source that does not exist.
C:\ProgramData\Anaconda3\Scripts\conda.exe
I faced the same issue and
conda update -n root conda
Solved the problem. The env name "root" is for conda <= 4.3, otherwise use:
conda update -n base conda
I hope this helps.
Try to run conda clean --all --yes and conda update anaconda.
Do you have a conda.exe file in the following folder C:\ProgramData\Anaconda3\Scripts\?
Do you use the latest Conda?
Another solution could be to create a conda environments conda create -n name_environment pip python=3.5 and using pip to install tensorflow pip install tensorflow inside the new environment
after having activated it (activate name_environment).
P.S. I can not write a comment because I do not have enough reputation.
EDIT - Now i can!

How to add a package to a new Anaconda environment?

I have installed the pygal package through the following command line:
conda install -c akode pygal
However, when I search this package in the Anaconda, I can only find this package in the base (root) environment. When I try to search this pygal package in my newly created environment, nothing can I find.
Why does this happen? and is there any solution to this problem?
When you are not in an environment and run conda install , it will install it in the base. If you activate your environment then install the package using conda install, it will apply to your environment.
source activate data_visualization_coursera
conda install -c akode pygal
Or you can install a specific package to an environment using this command
conda install -n <environment_name> <package_name>
You can find all of the documentation here https://conda.io/docs/user-guide/tasks/manage-environments.html

I get the following error whenever I try to run conda install tensorflow

This is the error :
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- numba -> numpy[version='>=1.14,<1.15.0a0']
- tensorflow
Use "conda info " to see the dependencies for each package.
You have to run the conda info tensorflow and conda info numba to see each dependencies for each package and then you have to install those package like conda install package=version to fix the problem.
First create a conda environment if you would like using
conda create -n my_env python=3.6
Here "my_env" is the name of my environment
Then activate your environment using
source activate my_env #(for mac)
conda activate my_env #(for windows)
Once the Environment is active. you can now install the packages you need as follows:I am showing you the packages which i work upon on virtual environment and this will take care of most of your dependencies
conda update conda
conda upgrade conda
conda upgrade anaconda
conda update numpy
conda install tensorflow
Hope this will solve your problem or else try to upgrade numpy using pip:
pip install --upgrade numpy

Categories