Reputation: 316
I am trying to install a python package using conda
in offline mode. I have to install in offline mode because of the network I am using.
The package I want to install is mlpack
, and I am using python3
on a Mac x64 with macOS Sierra 10.12.6. I downloaded mlpack
from the Anaconda webstie: https://anaconda.org/ilastik/mlpack
Then I used the command
conda install --offline -c ilastik /anaconda3/tars/mlpack-1.0.8.99-8.tar.bz2
and I receive the following output:
Downloading and Extracting Packages
*-None | | ############################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
When I look in anaconda3/pkgs I can see that a folder was created called mlpack
. However, when I try to run import mlpack
in Python, it says
import mlpack
Traceback (most recent call last):
File "<ipython-input-4-edcb40cca368>", line 1, in <module>
import mlpack
ModuleNotFoundError: No module named 'mlpack'
I tried adding -vv
to the install command and received this:
pn1503563$ conda install --offline -c ilastik /anaconda3/tars/mlpack-1.0.8.99-8.tar.bz2 -vv
DEBUG conda.gateways.logging:set_verbosity(148): verbosity set to 2
DEBUG conda.core.package_cache_data:__init__(549): instantiating ProgressiveFetchExtract with
*[url=file:///anaconda3/tars/mlpack-1.0.8.99-8.tar.bz2]
DEBUG conda.core.package_cache_data:_check_writable(237): package cache directory '/anaconda3/pkgs' writable: True
DEBUG conda.core.package_cache_data:_check_writable(237): package cache directory '/Users/nstegmeier/.conda/pkgs' writable: True
DEBUG conda.core.package_cache_data:_check_writable(237): package cache directory '/anaconda3/pkgs' writable: True
DEBUG conda.core.link:__init__(157): instantiating UnlinkLinkTransaction with
target_prefix: /anaconda3
unlink_precs:
<unknown>::mlpack-1.0.8.99-8
link_precs:
<unknown>::mlpack-1.0.8.99-8
DEBUG conda.core.package_cache_data:__init__(549): instantiating ProgressiveFetchExtract with
<unknown>::mlpack-1.0.8.99-8
Preparing transaction: ...working... DEBUG conda.core.link:_get_python_version(630): found in current prefix python version 3.6
done
Verifying transaction: ...working... done
DEBUG conda.common.signals:signal_handler(43): registering handler for SIGABRT
DEBUG conda.common.signals:signal_handler(43): registering handler for SIGINT
DEBUG conda.common.signals:signal_handler(43): registering handler for SIGTERM
DEBUG conda.common.signals:signal_handler(43): registering handler for SIGQUIT
Executing transaction: ...working... INFO conda.core.link:_execute_actions(542): ===> UNLINKING PACKAGE: <unknown>::mlpack-1.0.8.99-8 <===
prefix=/anaconda3
INFO conda.core.link:_execute_actions(548): ===> LINKING PACKAGE: <unknown>::mlpack-1.0.8.99-8 <===
prefix=/anaconda3
source=/anaconda3/pkgs/mlpack-1.0.8.99-8
done
DEBUG conda.common.signals:signal_handler(56): de-registering handler for Signals.SIGABRT
DEBUG conda.common.signals:signal_handler(56): de-registering handler for Signals.SIGINT
DEBUG conda.common.signals:signal_handler(56): de-registering handler for Signals.SIGTERM
DEBUG conda.common.signals:signal_handler(56): de-registering handler for Signals.SIGQUIT
The command conda info --offline
gives
pn1503563$ conda info --offline
active environment : None
user config file : /Users/nstegmeier/.condarc
populated config files : /Users/nstegmeier/.condarc
conda version : 4.5.4
conda-build version : 3.10.5
python version : 3.6.5.final.0
base environment : /anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/osx-64 (offline)
https://repo.anaconda.com/pkgs/main/noarch (offline)
https://repo.anaconda.com/pkgs/free/osx-64 (offline)
https://repo.anaconda.com/pkgs/free/noarch (offline)
https://repo.anaconda.com/pkgs/r/osx-64 (offline)
https://repo.anaconda.com/pkgs/r/noarch (offline)
https://repo.anaconda.com/pkgs/pro/osx-64 (offline)
https://repo.anaconda.com/pkgs/pro/noarch (offline)
package cache : /anaconda3/pkgs
/Users/nstegmeier/.conda/pkgs
envs directories : /anaconda3/envs
/Users/nstegmeier/.conda/envs
platform : osx-64
user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.5 Darwin/16.7.0 OSX/10.12.6
UID:GID : 507:20
netrc file : None
offline mode : True
Upvotes: 3
Views: 3425
Reputation: 1106
As was pointed out you should use mlpack from the official mlpack repository. Ilastik channel has a very old version of mlpack without python bindings.
To download all packages required for offline installation run the following command:
conda install -c mlpack -c conda-forge mlpack
After this, you can find all the required packages archives in <condadir>/pkgs
Optionally add ilastik channel (-c ilastik
) to this command if you need any packages from it.
Upvotes: 1