How to install tensorflow-transform on anaconda? - anaconda

We can install tensorflow-transform using pip but how do I install it using Conda?
I have tried using conda install -c anaconda tensorflow-transform and all its variants without result.

A search of Anaconda Cloud shows that tensorflow-transform is not available through any channels on any platform. Moreover, the recommended way to install the package is to use PyPI. However, one can still install the package into a specific Conda env by first activating the env:
conda activate your_env
pip install tensorflow-transform

Related

ModuleNotFoundError: No module named 'dask_geopandas'

i have dask, dask-core and dask geopandas installed as shown:
dask 2021.7.1 pyhd8ed1ab_0 conda-forge
dask-core 2021.7.1 pyhd8ed1ab_0 conda-forge
dask-geopandas 0.1.0a4 pypi_0 pypi
however, when importing I kept getting an error message :
"ModuleNotFoundError: No module named 'dask_geopandas'"
I wonder what has gone wrong with installation, thank you.
This could happen if pip install and conda install installed packages in different paths (this typically happens when the conda environment does not have its own pip).
A simple way out of this is to install everything with conda, so in this case you would run the following within your conda environment:
conda install -c conda-forge dask dask-geopandas
Alternatively, make sure that your conda environment has pip installed also and then run the pip within the conda environment:
conda install -c conda-forge dask pip
# if the conda environment is not activate, then activate it
# using: conda activate the_name_of_your_env
pip install dask-geopandas
In addition, there are specific instructions at https://geopandas.readthedocs.io/en/latest/getting_started/install.html#installing-with-pip about extra steps you may need to take when using pip - you might need a compiler available in your system.

How to avoid pip install package again while conda install was done before?

guys:
I use conda install tensorflow-gputo install tensorflow 2.0 , and
numpy=1.20.2 would be one of the package installed, and then I use python3 -m pip install SOMEPACKAGE ,this SOMEPACKAGE needs numpy to be installed as well , but pip seems does not check or realize the package numpy has already installed...
I would like to show everything I know so far :
1.I know the packages installed via conda install would go to anaconda3/envs/YOUR_ENV/lib/site-packages
2.I use python3 -m pip install -t anaconda3/envs/YOUR_ENV/lib/site-packages to force the package would be installed to the place where conda install would be.
However,pip still tries to dwonload *.whl file and install package again,I do not want this package installation process happen again ,while it did mention that I can use --upgrade to replace the existed package...
So I would like to know
How does pip and conda install check if the target package has already existed before they actually to through install process?
I think using python3 you are not using interpreter from your current conda environment so it gets installed elsewhere
python -m pip install (or simply pip install) from your activated environment should work and ignore dependencies installed by conda if they satisfy the requirements

What is the preferred way to install spdlib?

I use homebrew to install packages on my Mac OS High Sierra. However, I encountered a package called spdlib that is not available through homebrew. The package is available as an install through conda using the following (source):
conda install -c rios -c conda-forge spdlib
What is the preferred method of getting spdlib on my machine taking into account I do not want homebrew and conda to confict?
One way would be to install Miniconda.
Create a new environment:
conda create -n myenv python=3.6
activate it:
source activate myenv
with a new conda this should work too:
conda activate myenv
Now, you can install what you need without interfering with your homebrew packages:
(myenv) conda install -c rios -c conda-forge spdlib

Installing Python Package to Conda Env Without Using Conda

I have a fresh Anaconda environment in which I would like to install the latest release of mysql-connector-python (v2.1.3). I'm on a CentOS6 system. The problem is, the newest Conda-hosted package is 2.0.3 and because the connector is not currently hosted on PyPI, it cannot be installed via Pip. (Pip's --allow-external option has been deprecated.)
I know that I can easily install the package via yum install, but I believe that will install it outside of the Conda environment.
Is there any way, using yum or otherwise, to isolate this package solely to this particular Conda environment?
Turns out this is surprisingly simple. Just download the source for the Python package that is not available on PyPI and pip install at the source directory. Just remember to have the Conda environment you want to install to active and Pip will correctly isolate the install to env scope.
I was unaware of Pip's install from local options, so big thanks to the folks on the Anaconda mailing list for their help with this.

How to add package to conda environment without pip

How can I add a package to an existing conda environment?
If it is a python package I can use pip install <package>, but what if pip does not work?
Is it sufficient to activate the environment and use conda install <package>?
You've answered your own question. In fact you really want to do conda install ... instead of using pip if you can.
You can install a conda package also without activating the environment. Just use conda install -n <env_name> <package> or conda install -p <path/to/env> <package>.
If you want to install a specific package inside a specific conda environment, you can use the following command.
First activate the conda environment and then do:
$ conda install --name <conda_env_name> -c <channel_name> <package_name>
For a concrete example, let's assume that you want to install chainer from the channel anaconda to an already created conda environment named chainerenv, then you can do:
$ conda install --name chainerenv -c anaconda chainer
If you want to install a package in the environment, you can use
conda install -p /path/to/env package
example:
conda install -p /users/dekstop/env-test Django
There's an alternative way to do this and I have just tested it on my own mac:
example: i want to install a non-conda package at my python2.7 environment:
go to terminal
activate the desired environment by: source activate py27
after you successfully activated the environment, you can install the package you wanted by: pip install package
The answer is yes (usually).
One example is that you can activate your conda environment and then directly do conda install pandas.tar.bz2 on the existing tar.bz2 files from /conda_envs/.pkgs (leftovers from other environments)
If you don't have a tarball package like that but you have the src with setup.py you can just do the usual install by python setup.py install (or python setup.py develop to link the src)

Resources