我正在尝试使用这个repo:
https://github.com/CMU-Perceptual-Computing-Lab/MonocularTotalCapture
它需要"OpenCV 2.4.13 (使用CUDA9.0,CUDNN7.0从源代码编译而来)“,所以我尝试使用conda安装它。在我的系统中,默认的python安装是:
(base) root@ziom-Z87-HD3:/home/ziom# python
Python 2.7.16 |Anaconda, Inc.| (default, Sep 24 2019, 21:51:30)
[GCC 7.3.0] on linux2但是repo需要python 3.5,因此我使用以下命令切换到它:
alias python='/usr/bin/python3.5'看起来它起作用了。
(base) root@ziom-Z87-HD3:/home/ziom# python
Python 3.5.2 (default, Oct 8 2019, 13:06:37)
[GCC 5.4.0 20160609] on linux现在,它需要安装Python3.5和OpenCV 2.4.13,所以我给出了这个命令:
conda create -n ziomario pip python=3.5
conda activate ziomario此时,我应该安装OpenCV 2.4.13,并发出以下命令:
conda install -c conda-forge opencv=2.4.13但它不起作用,因为这是:
(ziomario) root@ziom-Z87-HD3:/home/ziom# conda install -c conda-forge opencv=2.4.13
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
Examining @/linux-64::__glibc==2.23=0: 25%|██▌ | 1/4 [00:00<00:00, 6026.3Examining python=3.5: 50%|█████ | 2/4 [00:00<00:00, 7351.98it/s] Examining conflict for python opencv: 25%|██▌ | 1/4 [00:00<00:00, 10979.8 failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- opencv=2.4.13 -> python=2.7
Your python: python=3.5
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
The following specifications were found to be incompatible with your CUDA driver:
- feature:/linux-64::__cuda==9.0=0
Your installed CUDA driver is: 9.0Opencv=2.4.13需要python=2.7,但存储库需要Python3.5。该怎么办呢。
发布于 2020-03-11 22:17:28
这很奇怪,因为repo明确地说它应该使用您正在尝试使用的内容。我的猜测是,有人在依赖列表上犯了一个错误。先尝试升级Opencv,然后再联系repo维护者,因为他们写了这个矛盾。
发布于 2020-03-11 22:27:55
为此,您可能需要使用"pyenv“
我找到了一个非常有用的网站:https://realpython.com/intro-to-pyenv/
假设您使用的是Ubuntu或Debian系统,我将对这些步骤进行总结。
首先,如果您还没有下载依赖项,请下载它:
$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl然后使用pyenv-installer:
$ curl https://pyenv.run | bash这将安装pyenv以及一些有用的插件:
用于pyenv的实际pyenv application
在运行结束时,您应该看到如下所示:
WARNING: seems you still have not added 'pyenv' to the load path.
# Load pyenv automatically by adding
# the following to ~/.bashrc:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
The output will be based on your shell. But you should follow the instructions to add pyenv to your path and to initialize pyenv/pyenv-virtualenv auto completion. Once you’ve done this, you need to reload your shell:$ exec "$SHELL" # Or just restart your terminal然后,您可以使用该命令安装python的版本:
$ pyenv install -v 3.5还有更多。(请转至网站)
https://stackoverflow.com/questions/60637825
复制相似问题