Reputation:
When I want to install modules to Anaconda, I run conda install
. However, now I have a .tar.gz
file and want to install this. How to do?
Upvotes: 43
Views: 118068
Reputation: 41
For computers without a network, you can install packages with the following steps:
Conda install <file.tar.bz2> still does not install dependencies #1884 stuarteberg
conda index
on the local channel directory.conda install -c file://${my_local_channel}
mkdir -p /tmp/my-local-channel/osx-64
mv ~/Downloads/mypackage-2.40-py37hc48c483_1.tar.bz2 /tmp/my-local-channel/osx-64
conda index /tmp/my-local-channel
conda install -c file:///tmp/my-local-channel mypackage
You may encounter CondaHTTPError
, I solved this by adding params: conda install -c file:///tmp/my-local-channel --no-deps --offline mypackage
. Please be aware of the risks behind these params.
Because I'm a rookie, feel free to correct me.
Upvotes: 0
Reputation: 1740
There are several ways to achieve this, I'm describing one here, which should be relatively straight forward, even if your default python
variable is not anaconda's.
conda info --envs
to see the path where your environment is installed"C:\Program Files\Anaconda3\python.exe"
<absolute path to python.exe> -m pip install <path to tar.gz>
for example:
C:\Program Files\Anaconda3\python.exe -m pip install c:\mymodule\great.tar.gz
Note that <path to tar.gz>
can be relative, absolute and even an online link.
Upvotes: 55
Reputation: 31
Just a PSA please don't use conda install <pkg.tar>
when updating python from a tar.bz. This has the potential to break Anaconda.
Upvotes: 2
Reputation: 37706
It depends on where your archive comes from:
pip
:pip install package.tar.gz
# Or:
python -m pip install package.tar.gz
conda
:conda install package.tar.gz
If you have multiple python installations, you may need to specify absolute path to the python/conda executable.
Note that the archive files on pypi and conda-forge are usually very different:
If you already have a working Anaconda distribution, I would encourage you to get archives from conda-forge instead of pypi.
Upvotes: 19
Reputation: 31
Here is how to do :
Q:\anaconda3\Scripts>conda install q:\quandl-3.4.4-py37_0.tar.bz2
Downloading and Extracting Packages
###########################################################################################
#################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Q:\anaconda3\Scripts>
Upvotes: 3
Reputation: 31
If you are using Anaconda and downloaded the package from Anaconda Cloud, then you can place your "package.tar.bz2" files in the path shown in Anaconda prompt (Eg. C:\Users) and type in the following command in Anaconda Prompt
conda install package.tar.bz2
I believe it will work for .tar.gz files too.
Upvotes: 1