我在为代码创建环境时遇到了一些问题. 该代码需要相当旧的Python版本,但我能够在我的Ubuntu 22.04 RTS(桌面)中重新创建环境.当我try 在Ubuntu 20.04(这是我必须使用它的机器的操作系统)上安装它时,问题就会出现,因为安装失败.该环境是从一个文件构建的,该文件的内容可以在下面找到.

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

为了创建环境,我使用miniconda 3,它可以安装除pip依赖项之外的任何内容.知道出了什么问题吗?


编辑: 终端中显示的完整错误如下:

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

推荐答案

错误表明您的机器上没有安装gcc个.您可以通过运行gcc --version来判断是否已安装,该gcc --version将在控制台上输出gcc版本.

如果未安装,您可以运行以下命令将其安装到ubuntu上:

sudo apt install build-essential

Python相关问答推荐

有条件地采样我的大型DF的最有效方法

jit JAX函数中的迭代器

如何计算列表列行之间的公共元素

如何在Python中使用io.BytesIO写入现有缓冲区?

多处理代码在while循环中不工作

Select 用a和i标签包裹的复选框?

大Pandas 胚胎中产生组合

比较两个数据帧并并排附加结果(获取性能警告)

时间序列分解

如何使用LangChain和AzureOpenAI在Python中解决AttribeHelp和BadPressMessage错误?

如果值发生变化,则列上的极性累积和

Python—从np.array中 Select 复杂的列子集

如何设置视频语言时上传到YouTube与Python API客户端

cv2.matchTemplate函数匹配失败

SQLAlchemy bindparam在mssql上失败(但在mysql上工作)

numpy数组和数组标量之间的不同行为

为什么dict. items()可以快速查找?

Pandas:计数器的滚动和,复位

如何在python tkinter中绑定键盘上的另一个回车?

将数据从一个单元格保存到Jupyter笔记本中的下一个单元格