pythonpipubuntu-20.04miniconda

Problems with Environment creation with miniconda


I have some problems creating an environment for my code. The code requires a quite old Python version, but I am able to recreate the environment in my Ubuntu 22.04 LTS (Desktop). The problem arises when I try to install it on Ubuntu 20.04 (which is the OS of the machine in which I have to use it), because the installation fails. The environment is build from a file, the contents of which can be found in the following.

name: tractome
channels:
  - https://repo.anaconda.com/pkgs/free
  - conda-forge
  - defaults
dependencies:
  - cython=0.29.7
  - pydicom=1.3.0
  - dipy=0.14.0
  - joblib=0.13.2
  - matplotlib=1.5.1
  - nibabel=2.4.0
  - numpy=1.11
  - pip=19.1
  - pyglet=1.3.2
  - pyqt=4.11.4
  - pyside=1.2.4
  - python=2.7.16
  - qt=4.8.7
  - pip:
    - git+https://github.com/fos/fos.git

To create the environment I am using miniconda3, and it can install anything except for the pip dependencies. Any idea what's going wrong?


EDIT: The complete error displayed in the terminal is this:

Building wheels for collected packages: fos
  Building wheel for fos (setup.py): started
  Building wheel for fos (setup.py): finished with status 'error'
  Running setup.py clean for fos
Failed to build fos
Installing collected packages: fos
  Running setup.py install for fos: started
    Running setup.py install for fos: finished with status 'error'

Pip subprocess error:
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
  Running command git clone -q https://github.com/fos/fos.git /tmp/pip-req-build-fKXgf6
  ERROR: Complete output from command /home/<user>/miniconda3/envs/tractome/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-req-build-fKXgf6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-PtL9MQ --python-tag cp27:
  ERROR: /home/<user>/miniconda3/envs/tractome/lib/python2.7/site-packages/setuptools/dist.py:351: UserWarning: Normalizing '0.3.0.dev' to '0.3.0.dev0'
    normalized_version,
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/fos
  copying fos/coords.py -> build/lib.linux-x86_64-2.7/fos
  copying fos/app.py -> build/lib.linux-x86_64-2.7/fos
  copying fos/color.py -> build/lib.linux-x86_64-2.7/fos
  copying fos/camera.py -> build/lib.linux-x86_64-2.7/fos
  copying fos/__init__.py -> build/lib.linux-x86_64-2.7/fos
  copying fos/world.py -> build/lib.linux-x86_64-2.7/fos
  copying fos/modelmat.py -> build/lib.linux-x86_64-2.7/fos
  copying fos/util.py -> build/lib.linux-x86_64-2.7/fos
  copying fos/vsml.py -> build/lib.linux-x86_64-2.7/fos
  copying fos/window.py -> build/lib.linux-x86_64-2.7/fos
  copying fos/light.py -> build/lib.linux-x86_64-2.7/fos
  copying fos/transform.py -> build/lib.linux-x86_64-2.7/fos
  creating build/lib.linux-x86_64-2.7/fos/interact
  copying fos/interact/__init__.py -> build/lib.linux-x86_64-2.7/fos/interact
  creating build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/skeleton.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/axes.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/scatter.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/mesh.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/scalebar.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/network.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/__init__.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/microcircuit.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/chutext.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/line.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/slicer.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/text.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/base.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/primitives.py -> build/lib.linux-x86_64-2.7/fos/actor
  copying fos/actor/tex3d.py -> build/lib.linux-x86_64-2.7/fos/actor
  creating build/lib.linux-x86_64-2.7/fos/shader
  copying fos/shader/lib.py -> build/lib.linux-x86_64-2.7/fos/shader
  copying fos/shader/__init__.py -> build/lib.linux-x86_64-2.7/fos/shader
  creating build/lib.linux-x86_64-2.7/fos/external
  copying fos/external/__init__.py -> build/lib.linux-x86_64-2.7/fos/external
  creating build/lib.linux-x86_64-2.7/fos/external/freetype
  copying fos/external/freetype/ft_enums.py -> build/lib.linux-x86_64-2.7/fos/external/freetype
  copying fos/external/freetype/ft_structs.py -> build/lib.linux-x86_64-2.7/fos/external/freetype
  copying fos/external/freetype/__init__.py -> build/lib.linux-x86_64-2.7/fos/external/freetype
  copying fos/external/freetype/ft_types.py -> build/lib.linux-x86_64-2.7/fos/external/freetype
  copying fos/external/freetype/ft_errors.py -> build/lib.linux-x86_64-2.7/fos/external/freetype
  creating build/lib.linux-x86_64-2.7/fos/data
  copying fos/data/__init__.py -> build/lib.linux-x86_64-2.7/fos/data
  creating build/lib.linux-x86_64-2.7/fos/actor/dynamic
  copying fos/actor/dynamic/skeleton.py -> build/lib.linux-x86_64-2.7/fos/actor/dynamic
  copying fos/actor/dynamic/__init__.py -> build/lib.linux-x86_64-2.7/fos/actor/dynamic
  running build_ext
  cythoning fos/interact/collision.pyx to fos/interact/collision.c
  /home/<user>/miniconda3/envs/tractome/lib/python2.7/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-req-build-fKXgf6/fos/interact/collision.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  warning: fos/interact/collision.pyx:272:16: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:272:21: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:346:14: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:346:19: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:346:24: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:346:28: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:375:15: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:375:20: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:375:25: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:462:14: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:462:18: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:462:22: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:478:16: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:478:22: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:478:28: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:577:39: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:579:17: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:579:23: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:581:18: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:581:26: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:581:34: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:709:14: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:709:21: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:709:28: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:785:14: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:785:21: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:785:28: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:857:16: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:857:23: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:857:30: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:857:37: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:857:44: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:857:51: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: fos/interact/collision.pyx:859:20: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  building 'fos.interact.collision' extension
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/fos
  creating build/temp.linux-x86_64-2.7/fos/interact
  gcc -pthread -B /home/<user>/miniconda3/envs/tractome/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/<user>/miniconda3/envs/tractome/lib/python2.7/site-packages/numpy/core/include -I/home/<user>/miniconda3/envs/tractome/include/python2.7 -c fos/interact/collision.c -o build/temp.linux-x86_64-2.7/fos/interact/collision.o
  unable to execute 'gcc': No such file or directory
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for fos
    ERROR: Complete output from command /home/<user>/miniconda3/envs/tractome/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-req-build-fKXgf6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-PBazb4/install-record.txt --single-version-externally-managed --compile:
    ERROR: /home/<user>/miniconda3/envs/tractome/lib/python2.7/site-packages/setuptools/dist.py:351: UserWarning: Normalizing '0.3.0.dev' to '0.3.0.dev0'
      normalized_version,
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/fos
    copying fos/coords.py -> build/lib.linux-x86_64-2.7/fos
    copying fos/app.py -> build/lib.linux-x86_64-2.7/fos
    copying fos/color.py -> build/lib.linux-x86_64-2.7/fos
    copying fos/camera.py -> build/lib.linux-x86_64-2.7/fos
    copying fos/__init__.py -> build/lib.linux-x86_64-2.7/fos
    copying fos/world.py -> build/lib.linux-x86_64-2.7/fos
    copying fos/modelmat.py -> build/lib.linux-x86_64-2.7/fos
    copying fos/util.py -> build/lib.linux-x86_64-2.7/fos
    copying fos/vsml.py -> build/lib.linux-x86_64-2.7/fos
    copying fos/window.py -> build/lib.linux-x86_64-2.7/fos
    copying fos/light.py -> build/lib.linux-x86_64-2.7/fos
    copying fos/transform.py -> build/lib.linux-x86_64-2.7/fos
    creating build/lib.linux-x86_64-2.7/fos/interact
    copying fos/interact/__init__.py -> build/lib.linux-x86_64-2.7/fos/interact
    creating build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/skeleton.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/axes.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/scatter.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/mesh.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/scalebar.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/network.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/__init__.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/microcircuit.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/chutext.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/line.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/slicer.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/text.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/base.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/primitives.py -> build/lib.linux-x86_64-2.7/fos/actor
    copying fos/actor/tex3d.py -> build/lib.linux-x86_64-2.7/fos/actor
    creating build/lib.linux-x86_64-2.7/fos/shader
    copying fos/shader/lib.py -> build/lib.linux-x86_64-2.7/fos/shader
    copying fos/shader/__init__.py -> build/lib.linux-x86_64-2.7/fos/shader
    creating build/lib.linux-x86_64-2.7/fos/external
    copying fos/external/__init__.py -> build/lib.linux-x86_64-2.7/fos/external
    creating build/lib.linux-x86_64-2.7/fos/external/freetype
    copying fos/external/freetype/ft_enums.py -> build/lib.linux-x86_64-2.7/fos/external/freetype
    copying fos/external/freetype/ft_structs.py -> build/lib.linux-x86_64-2.7/fos/external/freetype
    copying fos/external/freetype/__init__.py -> build/lib.linux-x86_64-2.7/fos/external/freetype
    copying fos/external/freetype/ft_types.py -> build/lib.linux-x86_64-2.7/fos/external/freetype
    copying fos/external/freetype/ft_errors.py -> build/lib.linux-x86_64-2.7/fos/external/freetype
    creating build/lib.linux-x86_64-2.7/fos/data
    copying fos/data/__init__.py -> build/lib.linux-x86_64-2.7/fos/data
    creating build/lib.linux-x86_64-2.7/fos/actor/dynamic
    copying fos/actor/dynamic/skeleton.py -> build/lib.linux-x86_64-2.7/fos/actor/dynamic
    copying fos/actor/dynamic/__init__.py -> build/lib.linux-x86_64-2.7/fos/actor/dynamic
    running build_ext
    skipping 'fos/interact/collision.c' Cython extension (up-to-date)
    building 'fos.interact.collision' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/fos
    creating build/temp.linux-x86_64-2.7/fos/interact
    gcc -pthread -B /home/<user>/miniconda3/envs/tractome/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/<user>/miniconda3/envs/tractome/lib/python2.7/site-packages/numpy/core/include -I/home/<user>/miniconda3/envs/tractome/include/python2.7 -c fos/interact/collision.c -o build/temp.linux-x86_64-2.7/fos/interact/collision.o
    unable to execute 'gcc': No such file or directory
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/home/<user>/miniconda3/envs/tractome/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-req-build-fKXgf6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-PBazb4/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-fKXgf6/

failed

CondaEnvException: Pip failed

Solution

  • The error says that you do not have gcc installed on your machine. You can check if you have it installed by running gcc --version which will output gcc version on console.

    If it is not installed, you can run the following to install it on ubuntu:

    sudo apt install build-essential