Given the following, with Miniconda (4.5.4) installed:
$ conda create --name myenv python=2
<update and install of packages>
$ source activate myenv
(myenv) $ python --version
Python 2.7.16 :: Anaconda, Inc.
(myenv) $ conda install -c conda-forge iris
<installing>
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(myenv) $ python
>>> import iris
Ambiguous 'iris' package.
Please use either:
illumon-iris - Python integration for Illumon Iris, a time-series database
- pip install illumon-iris
- https://pypi.python.org/pypi/illumon-iris
- https://www.illumon.com/
SciTools Iris - Python library for analysing and visualising meteorological and oceanographic data sets
- http://scitools.org.uk/iris/
info.gianlucacosta.iris - A general-purpose library for Python
- pip install info.gianlucacosta.iris
- https://pypi.python.org/pypi/info.gianlucacosta.iris
This is the same error generated if you try and install iris from pip (which I know is not advertised as being the recommended way)
@wood-chris Curious. Using conda and miniconda this should just work i.e.,
conda create -n my-iris -c conda-forge iris python=2
If you're using pip then make sure to install scitools-iris instead - unfortunately we were too slow to claim the iris namespace on PyPI.
Does this help?
Can you clarify exactly the steps you're taking to install iris into a fresh miniconda environment?
Thanks
@bjlittle unfortunately not! Full output:
$ conda create -n my-iris -c conda-forge iris python=2
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.5.4
latest version: 4.7.12
Please update conda by running
$ conda update -n base conda
## Package Plan ##
environment location: /home/chris/.conda/envs/my-iris
added / updated specs:
- iris
- python=2
The following packages will be downloaded:
package | build
---------------------------|-----------------
libnetcdf-4.7.1 |nompi_h94020b1_101 1.3 MB conda-forge
netcdf4-1.5.1.2 | py27hf3213d6_2 510 KB conda-forge
wheel-0.33.6 | py27_0 35 KB conda-forge
libffi-3.2.1 | he1b5a44_1006 46 KB conda-forge
libedit-3.1.20170329 | hf8c457e_1001 172 KB conda-forge
readline-8.0 | hf8c457e_0 441 KB conda-forge
hdf5-1.10.5 |nompi_h3c11f04_1103 3.1 MB conda-forge
python-2.7.15 | h5a48372_1009 12.7 MB conda-forge
fontconfig-2.13.1 | h86ecdb6_1001 340 KB conda-forge
ncurses-6.1 | hf484d3e_1002 1.3 MB conda-forge
krb5-1.16.3 | h05b26f9_1001 1.4 MB conda-forge
zlib-1.2.11 | h516909a_1006 105 KB conda-forge
sqlite-3.30.1 | hcee41ef_0 2.0 MB conda-forge
curl-7.65.3 | hf8cf82a_0 132 KB conda-forge
tk-8.6.9 | hed695b0_1003 3.2 MB conda-forge
libcurl-7.65.3 | hda55be3_0 575 KB conda-forge
qt-5.9.7 | h0c104cb_3 80.8 MB conda-forge
pip-19.3.1 | py27_0 1.9 MB conda-forge
pillow-6.2.0 | py27h6b7be26_0 633 KB conda-forge
icu-64.2 | he1b5a44_1 12.6 MB conda-forge
cartopy-0.17.0 |py27h4331854_1007 1.8 MB conda-forge
libxml2-2.9.9 | hee79883_5 1.3 MB conda-forge
setuptools-41.4.0 | py27_0 646 KB conda-forge
matplotlib-base-2.2.4 | py27h250f245_1 6.6 MB conda-forge
matplotlib-2.2.4 | py27_1 7 KB conda-forge
------------------------------------------------------------
Total: 133.5 MB
The following NEW packages will be INSTALLED:
_libgcc_mutex: 0.1-main
aenum: 2.2.0-py_0 conda-forge
asn1crypto: 1.2.0-py27_0 conda-forge
backports: 1.0-py_2 conda-forge
backports.functools_lru_cache: 1.5-py_1 conda-forge
backports_abc: 0.5-py_1 conda-forge
bokeh: 1.3.4-py27_0 conda-forge
bzip2: 1.0.8-h516909a_1 conda-forge
ca-certificates: 2019.9.11-hecc5488_0 conda-forge
cartopy: 0.17.0-py27h4331854_1007 conda-forge
certifi: 2019.9.11-py27_0 conda-forge
cf-units: 2.1.3-py27hc1659b7_0 conda-forge
cffi: 1.13.0-py27h8022711_0 conda-forge
cftime: 1.0.3.4-py27hd352d35_1001 conda-forge
chardet: 3.0.4-py27_1003 conda-forge
click: 7.0-py_0 conda-forge
cloudpickle: 1.2.2-py_0 conda-forge
cryptography: 2.7-py27h72c5cf5_0 conda-forge
curl: 7.65.3-hf8cf82a_0 conda-forge
cycler: 0.10.0-py_1 conda-forge
cytoolz: 0.10.0-py27h516909a_0 conda-forge
dask: 1.2.2-py_3 conda-forge
dask-core: 1.2.2-py_0 conda-forge
dbus: 1.13.6-he372182_0 conda-forge
distributed: 1.28.1-py27_0 conda-forge
enum34: 1.1.6-py27_1001 conda-forge
expat: 2.2.5-he1b5a44_1004 conda-forge
fontconfig: 2.13.1-h86ecdb6_1001 conda-forge
freetype: 2.10.0-he983fc9_1 conda-forge
functools32: 3.2.3.2-py_3 conda-forge
futures: 3.3.0-py27_0 conda-forge
geos: 3.7.2-he1b5a44_2 conda-forge
gettext: 0.19.8.1-hc5be6a0_1002 conda-forge
glib: 2.58.3-h6f030ca_1002 conda-forge
gst-plugins-base: 1.14.5-h0935bb2_0 conda-forge
gstreamer: 1.14.5-h36ae1b5_0 conda-forge
hdf4: 4.2.13-h9a582f1_1002 conda-forge
hdf5: 1.10.5-nompi_h3c11f04_1103 conda-forge
heapdict: 1.0.1-py_0 conda-forge
icu: 64.2-he1b5a44_1 conda-forge
idna: 2.8-py27_1000 conda-forge
ipaddress: 1.0.23-py_0 conda-forge
iris: 2.2.1-py27_0 conda-forge
jinja2: 2.10.3-py_0 conda-forge
jpeg: 9c-h14c3975_1001 conda-forge
kiwisolver: 1.1.0-py27hc9558a2_0 conda-forge
krb5: 1.16.3-h05b26f9_1001 conda-forge
libblas: 3.8.0-14_openblas conda-forge
libcblas: 3.8.0-14_openblas conda-forge
libcurl: 7.65.3-hda55be3_0 conda-forge
libedit: 3.1.20170329-hf8c457e_1001 conda-forge
libffi: 3.2.1-he1b5a44_1006 conda-forge
libgcc-ng: 9.1.0-hdf63c60_0
libgfortran-ng: 7.3.0-hdf63c60_2 conda-forge
libiconv: 1.15-h516909a_1005 conda-forge
liblapack: 3.8.0-14_openblas conda-forge
libnetcdf: 4.7.1-nompi_h94020b1_101 conda-forge
libopenblas: 0.3.7-h6e990d7_2 conda-forge
libpng: 1.6.37-hed695b0_0 conda-forge
libssh2: 1.8.2-h22169c7_2 conda-forge
libstdcxx-ng: 9.1.0-hdf63c60_0
libtiff: 4.0.10-hfc65ed5_1004 conda-forge
libuuid: 2.32.1-h14c3975_1000 conda-forge
libxcb: 1.13-h14c3975_1002 conda-forge
libxml2: 2.9.9-hee79883_5 conda-forge
locket: 0.2.0-py_2 conda-forge
lz4-c: 1.8.3-he1b5a44_1001 conda-forge
markupsafe: 1.1.1-py27h14c3975_0 conda-forge
matplotlib: 2.2.4-py27_1 conda-forge
matplotlib-base: 2.2.4-py27h250f245_1 conda-forge
msgpack-python: 0.6.2-py27hc9558a2_0 conda-forge
ncurses: 6.1-hf484d3e_1002 conda-forge
netcdf4: 1.5.1.2-py27hf3213d6_2 conda-forge
numpy: 1.16.4-py27h95a1406_0 conda-forge
olefile: 0.46-py_0 conda-forge
openssl: 1.1.1c-h516909a_0 conda-forge
owslib: 0.18.0-py_0 conda-forge
packaging: 19.2-py_0 conda-forge
pandas: 0.24.2-py27hb3f55d8_0 conda-forge
partd: 1.0.0-py_0 conda-forge
pcre: 8.43-he1b5a44_0 conda-forge
pillow: 6.2.0-py27h6b7be26_0 conda-forge
pip: 19.3.1-py27_0 conda-forge
proj4: 6.1.1-hc80f0dc_1 conda-forge
psutil: 5.6.3-py27h516909a_0 conda-forge
pthread-stubs: 0.4-h14c3975_1001 conda-forge
pycparser: 2.19-py27_1 conda-forge
pyepsg: 0.4.0-py_0 conda-forge
pykdtree: 1.3.1-py27h3010b51_1002 conda-forge
pyke: 1.1.1-py27_1000 conda-forge
pyopenssl: 19.0.0-py27_0 conda-forge
pyparsing: 2.4.2-py_0 conda-forge
pyproj: 2.2.2-py27h2fd02e8_0 conda-forge
pyqt: 5.9.2-py27hcca6a23_4 conda-forge
pyshp: 2.1.0-py_0 conda-forge
pysocks: 1.7.1-py27_0 conda-forge
python: 2.7.15-h5a48372_1009 conda-forge
python-dateutil: 2.8.0-py_0 conda-forge
pytz: 2019.3-py_0 conda-forge
pyyaml: 5.1.2-py27h516909a_0 conda-forge
qt: 5.9.7-h0c104cb_3 conda-forge
readline: 8.0-hf8c457e_0 conda-forge
requests: 2.22.0-py27_1 conda-forge
scipy: 1.2.1-py27h921218d_2 conda-forge
setuptools: 41.4.0-py27_0 conda-forge
shapely: 1.6.4-py27hec07ddf_1006 conda-forge
singledispatch: 3.4.0.3-py27_1000 conda-forge
sip: 4.19.8-py27hf484d3e_1000 conda-forge
six: 1.12.0-py27_1000 conda-forge
sortedcontainers: 2.1.0-py_0 conda-forge
sqlite: 3.30.1-hcee41ef_0 conda-forge
subprocess32: 3.5.4-py27h516909a_0 conda-forge
tblib: 1.4.0-py_0 conda-forge
tk: 8.6.9-hed695b0_1003 conda-forge
toolz: 0.10.0-py_0 conda-forge
tornado: 5.1.1-py27h14c3975_1000 conda-forge
udunits2: 2.2.27.6-h4e0c4b3_1001 conda-forge
urllib3: 1.25.6-py27_0 conda-forge
wheel: 0.33.6-py27_0 conda-forge
xorg-libxau: 1.0.9-h14c3975_0 conda-forge
xorg-libxdmcp: 1.1.3-h516909a_0 conda-forge
xz: 5.2.4-h14c3975_1001 conda-forge
yaml: 0.1.7-h14c3975_1001 conda-forge
zict: 1.0.0-py_0 conda-forge
zlib: 1.2.11-h516909a_1006 conda-forge
zstd: 1.4.3-h3b9ef0a_0 conda-forge
Proceed ([y]/n)?
Downloading and Extracting Packages
libnetcdf-4.7.1 | 1.3 MB | ####################################### | 100%
netcdf4-1.5.1.2 | 510 KB | ####################################### | 100%
wheel-0.33.6 | 35 KB | ####################################### | 100%
libffi-3.2.1 | 46 KB | ####################################### | 100%
libedit-3.1.20170329 | 172 KB | ####################################### | 100%
readline-8.0 | 441 KB | ####################################### | 100%
hdf5-1.10.5 | 3.1 MB | ####################################### | 100%
python-2.7.15 | 12.7 MB | ####################################### | 100%
fontconfig-2.13.1 | 340 KB | ####################################### | 100%
ncurses-6.1 | 1.3 MB | ####################################### | 100%
krb5-1.16.3 | 1.4 MB | ####################################### | 100%
zlib-1.2.11 | 105 KB | ####################################### | 100%
sqlite-3.30.1 | 2.0 MB | ####################################### | 100%
curl-7.65.3 | 132 KB | ####################################### | 100%
tk-8.6.9 | 3.2 MB | ####################################### | 100%
libcurl-7.65.3 | 575 KB | ####################################### | 100%
qt-5.9.7 | 80.8 MB | ####################################### | 100%
pip-19.3.1 | 1.9 MB | ####################################### | 100%
pillow-6.2.0 | 633 KB | ####################################### | 100%
icu-64.2 | 12.6 MB | ####################################### | 100%
cartopy-0.17.0 | 1.8 MB | ####################################### | 100%
libxml2-2.9.9 | 1.3 MB | ####################################### | 100%
setuptools-41.4.0 | 646 KB | ####################################### | 100%
matplotlib-base-2.2. | 6.6 MB | ####################################### | 100%
matplotlib-2.2.4 | 7 KB | ####################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > source activate my-iris
#
# To deactivate an active environment, use:
# > source deactivate
#
$ source activate my-iris
(my-iris) $ python --version
Python 2.7.15
(my-iris) $ python
Python 2.7.15 | packaged by conda-forge | (default, Jul 2 2019, 00:39:44)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
readline: /etc/inputrc: line 18: term: unknown variable name
>>> import iris
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/z01/z01/ccwz01/.local/lib/python2.7/site-packages/iris/__init__.py", line 18, in <module>
""")
RuntimeError:
Ambiguous 'iris' package.
Please use either:
illumon-iris - Python integration for Illumon Iris, a time-series database
- pip install illumon-iris
- https://pypi.python.org/pypi/illumon-iris
- https://www.illumon.com/
SciTools Iris - Python library for analysing and visualising meteorological and oceanographic data sets
- http://scitools.org.uk/iris/
info.gianlucacosta.iris - A general-purpose library for Python
- pip install info.gianlucacosta.iris
- https://pypi.python.org/pypi/info.gianlucacosta.iris
>>>
Hmm... I've found some differences. It does work on my local machine - I'm only seeing an error on a shared compute resource, where I have to load a module
anaconda/miniconda/4.5.4-python2.7
(anaconda is also available as a separate module).
The module _does_ load the correct version though:
$ conda --version
conda 4.5.4
perhaps there's some weird conflict going on somewhere...
The error is coming from a module located at /home/z01/z01/ccwz01/.local/lib/python2.7/site-packages/iris/__init__.py which is not within your conda installation. This is likely some other installation of an iris module into your home directory that is interfering. To verify can you please try running python with
PYTHONNOUSERSITE=true python
and then try to import iris.
@wood-chris Thanks, that's really helpful.
Okay, given the output I'm guessing that you have one or more .pth files in your ~/.local/lib/python2.7/site-packages which is picking up a different installed iris from elsewhere that isn't our SciTools iris. Hence the weird RuntimeError traceback.
Also make sure you haven't altered your PYTHONPATH from your shell startup e.g., ~/.bashrc`
@ajdawson thanks - that worked! I didn't know about the PYTHONNOUSERSITE setting 馃憤
@wood-chris Also see python --help, or https://docs.python.org/3/using/cmdline.html
You can also do python -s
Are you happy for me to close this issue?
@wood-chris I think your solution will be to remove the iris module/package installed in your home directory so that it does not interfere with other installations.
Yeh, I hadn't even realised I had attempted to install it. I'd forgotten python was that picky about where things are installed...!
Awesome, thanks @wood-chris and @ajdawson 馃槃