0

警告:我是 python 和 pipenv 的新手

我正在尝试使用shakedownwith创建可重现的 DC/OS 测试设置pipenv。我认为接下来的pipenv问题更多。

我第一次安装:

pipenv install dcoscli

如果我这样做,pipenv shell & pip list我可以看到:

...
dcoscli (0.5.7)
...

然后,我尝试安装dcos-shakedown,它抱怨它找不到dcoscli==0.5.7

pipenv install dcos-shakedown
CRITICAL:pip.index:Could not find a version that satisfies the requirement dcoscli==0.5.7 (from versions: 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.1.10, 0.1.11, 0.1.12, 0.1.13, 0.1.14, 0.1.15, 0.2.0, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.5, 0.4.6, 0.4.10, 0.4.11, 0.4.12, 0.4.13, 0.4.14)
Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies

尽管出现错误消息,但dcos-shakedown似乎已安装并正常工作。

pipenv shell
python
------
Python 3.6.3 (default, Oct  3 2017, 21:45:48) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from shakedown import *
(succeeds)

安装失败后我的 Pipfile 如下所示:

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[dev-packages]



[packages]

dcoscli = "*"
dcos-shakedown = "*"
behave = "*"


[requires]

python_version = "3.6"

我也尝试显式安装pipenv install dcoscli==0.5.7,但收到与上述相同的错误消息。

pip install我确实在两个依赖项的 virtualenv ( ) 中尝试了一个“普通” pipenv shell,它没有给我任何问题。(我确实在试验之间清理了virtualenv目录以避免污染)

我做错了什么还是我面临一些错误?

4

1 回答 1

1

所以这对我来说很好。如果我在 MacOS 或 Ubuntu 上从头开始

$ pipenv install dcoscli
Creating a virtualenv for this project…
⠋Using real prefix '/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/username/.local/share/virtualenvs/username-T-RxC1Pn/bin/python3.6
Also creating executable in /Users/username/.local/share/virtualenvs/username-T-RxC1Pn/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /Users/username/.local/share/virtualenvs/username-T-RxC1Pn
Installing dcoscli…
Collecting dcoscli
  Using cached dcoscli-0.5.7-py3-none-any.whl
Collecting pkginfo==1.2.1 (from dcoscli)
Collecting cryptography==2.0.2 (from dcoscli)
  Using cached cryptography-2.0.2-cp36-cp36m-macosx_10_6_intel.whl
Collecting sseclient==0.0.14 (from dcoscli)
Collecting virtualenv<16.0,>=13.0 (from dcoscli)
  Using cached virtualenv-15.1.0-py2.py3-none-any.whl
Collecting retrying==1.3.3 (from dcoscli)
Collecting toml<1.0,>=0.9 (from dcoscli)
Collecting dcos==0.5.7 (from dcoscli)
  Using cached dcos-0.5.7-py3-none-any.whl
Collecting docopt<1.0,>=0.6 (from dcoscli)
Collecting six>=1.4.1 (from cryptography==2.0.2->dcoscli)
  Using cached six-1.11.0-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography==2.0.2->dcoscli)
  Using cached asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting cffi>=1.7 (from cryptography==2.0.2->dcoscli)
  Using cached cffi-1.11.2-cp36-cp36m-macosx_10_6_intel.whl
Collecting idna>=2.1 (from cryptography==2.0.2->dcoscli)
  Using cached idna-2.6-py2.py3-none-any.whl
Collecting requests>=2.0.0 (from sseclient==0.0.14->dcoscli)
  Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting pygments<3.0,>=2.0 (from dcos==0.5.7->dcoscli)
  Using cached Pygments-2.2.0-py2.py3-none-any.whl
Collecting pager<4.0,>=3.3 (from dcos==0.5.7->dcoscli)
Collecting jsonschema<3.0,>=2.5 (from dcos==0.5.7->dcoscli)
  Using cached jsonschema-2.6.0-py2.py3-none-any.whl
Collecting PyJWT==1.4.2 (from dcos==0.5.7->dcoscli)
  Using cached PyJWT-1.4.2-py2.py3-none-any.whl
Collecting prettytable<1.0,>=0.7 (from dcos==0.5.7->dcoscli)
Collecting pycparser (from cffi>=1.7->cryptography==2.0.2->dcoscli)
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.0.0->sseclient==0.0.14->dcoscli)
  Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.0.0->sseclient==0.0.14->dcoscli)
  Using cached certifi-2017.11.5-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests>=2.0.0->sseclient==0.0.14->dcoscli)
  Using cached urllib3-1.22-py2.py3-none-any.whl
Installing collected packages: pkginfo, six, asn1crypto, pycparser, cffi, idna, cryptography, chardet, certifi, urllib3, requests, sseclient, virtualenv, retrying, toml, pygments, pager, jsonschema, PyJWT, prettytable, dcos, docopt, dcoscli
Successfully installed PyJWT-1.4.2 asn1crypto-0.24.0 certifi-2017.11.5 cffi-1.11.2 chardet-3.0.4 cryptography-2.0.2 dcos-0.5.7 dcoscli-0.5.7 docopt-0.6.2 idna-2.6 jsonschema-2.6.0 pager-3.3 pkginfo-1.2.1 prettytable-0.7.2 pycparser-2.18 pygments-2.2.0 requests-2.18.4 retrying-1.3.3 six-1.11.0 sseclient-0.0.14 toml-0.9.4 urllib3-1.22 virtualenv-15.1.0

Adding dcoscli to Pipfile's [packages]…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (120443)!

$ pipenv install dcos-shakedown
Installing dcos-shakedown…
Collecting dcos-shakedown
Requirement already satisfied: dcoscli==0.5.7 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcos-shakedown)
Collecting scp (from dcos-shakedown)
  Using cached scp-0.10.2-py2.py3-none-any.whl
Collecting pytest-timeout (from dcos-shakedown)
  Using cached pytest_timeout-1.2.1-py2.py3-none-any.whl
Collecting click (from dcos-shakedown)
  Using cached click-6.7-py2.py3-none-any.whl
Requirement already satisfied: retrying in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcos-shakedown)
Collecting pytest (from dcos-shakedown)
  Using cached pytest-3.3.2-py2.py3-none-any.whl
Collecting paramiko (from dcos-shakedown)
  Using cached paramiko-2.4.0-py2.py3-none-any.whl
Requirement already satisfied: sseclient==0.0.14 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: toml<1.0,>=0.9 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: docopt<1.0,>=0.6 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: dcos==0.5.7 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: pkginfo==1.2.1 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: cryptography==2.0.2 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: virtualenv<16.0,>=13.0 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: six>=1.7.0 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from retrying->dcos-shakedown)
Collecting py>=1.5.0 (from pytest->dcos-shakedown)
  Using cached py-1.5.2-py2.py3-none-any.whl
Collecting attrs>=17.2.0 (from pytest->dcos-shakedown)
  Using cached attrs-17.4.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from pytest->dcos-shakedown)
Collecting pluggy<0.7,>=0.5 (from pytest->dcos-shakedown)
Collecting pynacl>=1.0.1 (from paramiko->dcos-shakedown)
  Using cached PyNaCl-1.2.1-cp36-cp36m-macosx_10_6_intel.whl
Collecting pyasn1>=0.1.7 (from paramiko->dcos-shakedown)
  Using cached pyasn1-0.4.2-py2.py3-none-any.whl
Collecting bcrypt>=3.1.3 (from paramiko->dcos-shakedown)
  Using cached bcrypt-3.1.4-cp36-cp36m-macosx_10_6_intel.whl
Requirement already satisfied: requests>=2.0.0 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from sseclient==0.0.14->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: pager<4.0,>=3.3 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcos==0.5.7->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: PyJWT==1.4.2 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcos==0.5.7->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: pygments<3.0,>=2.0 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcos==0.5.7->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: jsonschema<3.0,>=2.5 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcos==0.5.7->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: prettytable<1.0,>=0.7 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from dcos==0.5.7->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: idna>=2.1 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from cryptography==2.0.2->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: cffi>=1.7 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from cryptography==2.0.2->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: asn1crypto>=0.21.0 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from cryptography==2.0.2->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from requests>=2.0.0->sseclient==0.0.14->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from requests>=2.0.0->sseclient==0.0.14->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: certifi>=2017.4.17 in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from requests>=2.0.0->sseclient==0.0.14->dcoscli==0.5.7->dcos-shakedown)
Requirement already satisfied: pycparser in ./.local/share/virtualenvs/username-T-RxC1Pn/lib/python3.6/site-packages (from cffi>=1.7->cryptography==2.0.2->dcoscli==0.5.7->dcos-shakedown)
Installing collected packages: pynacl, pyasn1, bcrypt, paramiko, scp, py, attrs, pluggy, pytest, pytest-timeout, click, dcos-shakedown
Successfully installed attrs-17.4.0 bcrypt-3.1.4 click-6.7 dcos-shakedown-1.4.12 paramiko-2.4.0 pluggy-0.6.0 py-1.5.2 pyasn1-0.4.2 pynacl-1.2.1 pytest-3.3.2 pytest-timeout-1.2.1 scp-0.10.2

Adding dcos-shakedown to Pipfile's [packages]…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (120443)!

现在看起来您可能正在pipenv从已经获取的venvhttps://virtualenv.pypa.io/en/stable/运行

我会从香草壳开始。或者检查 shell 上的 PATH 变量是否没有指向系统上的“不同”python 二进制文件

于 2018-01-10T22:01:54.690 回答