最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】pipenv如何安装更新了的Pipfile中的库

安装 crifan 1931浏览 0评论
对于一个已有的Pipenv的虚拟环境,手动在[packages]中加了其他一些库
希望去用pipenv去安装,更新,同步这些库。
最开始是有个重复了requests的库,所以报错重复了:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
prettytoml.elements.errors.InvalidElementError: Duplicate keys found
 
During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
  File "/Users/crifan/Library/Python/3.6/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_
ctx.command.invoke(sub_ctx
))
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/cli.py", line 1049, in sync
    pypi_mirror=pypi_mirror,
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/core.py", line 2518, in do_sync
    system=system,
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/core.py", line 1322, in do_init
    pypi_mirror=pypi_mirror,
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/core.py", line 807, in do_install_dependencies
    pypi_mirror=pypi_mirror,
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/core.py", line 1419, in pip_install
    for idx in project.pipfile_sources:
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/project.py", line 657, in pipfile_sources
    if 'source' not in self.parsed_pipfile:
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/project.py", line 396, in parsed_pipfile
    parsed = self._parse_pipfile(contents)
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/project.py", line 445, in _parse_pipfile
    return toml.loads(contents)
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/toml.py", line 373, in loads
    multibackslash)
  File "/Users/crifan/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/toml.py", line 481, in _load_line
    raise TomlDecodeError("Duplicate keys!")
toml.TomlDecodeError: Duplicate keys!
删除了就好了。
然后继续参考help:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
➜  xxxRobotDemoServer git:(master) ✗ pipenv --help
Usage: pipenv [OPTIONS] COMMAND [ARGS]...
 
Options:
  --where             Output project home information.
  --venv              Output virtualenv information.
  --py                Output Python interpreter information.
  --envs              Output Environment Variable options.
  --rm                Remove the virtualenv.
  --bare              Minimal output.
  --completion        Output completion (to be eval'd).
  --man               Display manpage.
  --three / --two     Use Python 3/2 when creating virtualenv.
  --python TEXT       Specify which version of Python virtualenv should use.
  --site-packages     Enable site-packages for the virtualenv.
  --pypi-mirror TEXT  Specify a PyPI mirror.
  --support           Output diagnostic information for use in Github issues.
  --version           Show the version and exit.
  -h, --help          Show this message and exit.
 
 
Usage Examples:
   Create a new project using Python 3.6, specifically:
   $ pipenv --python 3.6
 
   Install all dependencies for a project (including dev):
   $ pipenv install --dev
 
   Create a lockfile containing pre-releases:
   $ pipenv lock --pre
 
   Show a graph of your installed dependencies:
   $ pipenv graph
 
   Check your installed dependencies for security vulnerabilities:
   $ pipenv check
 
   Install a local setup.py into your virtual environment/Pipfile:
   $ pipenv install -e .
 
   Use a lower-level pip command:
   $ pipenv run pip freeze
 
Commands:
  check      Checks for security vulnerabilities and against PEP 508 markers
             provided in Pipfile.
  clean      Uninstalls all packages not specified in Pipfile.lock.
  graph      Displays currently-installed dependency graph information.
  install    Installs provided packages and adds them to Pipfile, or (if none
             is given), installs all packages.
  lock       Generates Pipfile.lock.
  open       View a given module in your editor.
  run        Spawns a command installed into the virtualenv.
  shell      Spawns a shell within the virtualenv.
  sync       Installs all packages specified in Pipfile.lock.
  uninstall  Un-installs a provided package and removes it from Pipfile.
  update     Runs lock, then sync.
试了试sync:
1
2
3
4
5
6
➜  xxxRobotDemoServer git:(master) ✗ pipenv sync
Installing dependencies from Pipfile.lock (512a06)...
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 35/35 — 00:00:09
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
All dependencies are now up-to-date!
结果没用:
调试时还是报错:
ModuleNotFoundError: No module named ‘numpy’
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
➜  xxxRobotDemoServer git:(master) ✗ pipenv graph
fabric==2.3.1
  - cryptography [required: >=1.1, installed: 2.3.1]
    - asn1crypto [required: >=0.21.0, installed: 0.24.0]
    - cffi [required: >=1.7,!=1.11.3, installed: 1.11.5]
      - pycparser [required: Any, installed: 2.18]
    - idna [required: >=2.1, installed: 2.7]
    - six [required: >=1.4.1, installed: 1.11.0]
  - invoke [required: >=1.1,<2.0, installed: 1.1.1]
  - paramiko [required: >=2.4, installed: 2.4.1]
    - bcrypt [required: >=3.1.3, installed: 3.1.4]
      - cffi [required: >=1.1, installed: 1.11.5]
        - pycparser [required: Any, installed: 2.18]
      - six [required: >=1.4.1, installed: 1.11.0]
    - cryptography [required: >=1.5, installed: 2.3.1]
      - asn1crypto [required: >=0.21.0, installed: 0.24.0]
      - cffi [required: >=1.7,!=1.11.3, installed: 1.11.5]
        - pycparser [required: Any, installed: 2.18]
      - idna [required: >=2.1, installed: 2.7]
      - six [required: >=1.4.1, installed: 1.11.0]
    - pyasn1 [required: >=0.1.7, installed: 0.4.4]
    - pynacl [required: >=1.0.1, installed: 1.2.1]
      - cffi [required: >=1.4.1, installed: 1.11.5]
        - pycparser [required: Any, installed: 2.18]
      - six [required: Any, installed: 1.11.0]
Flask-Celery-Helper==1.1.0
  - celery [required: Any, installed: 4.2.1]
    - billiard [required: >=3.5.0.2,<3.6.0, installed: 3.5.0.4]
    - kombu [required: >=4.2.0,<5.0, installed: 4.2.1]
      - amqp [required: >=2.1.4,<3.0, installed: 2.3.2]
        - vine [required: >=1.1.3, installed: 1.1.4]
    - pytz [required: >dev, installed: 2018.5]
  - Flask [required: Any, installed: 1.0.2]
    - click [required: >=5.1, installed: 6.7]
    - itsdangerous [required: >=0.24, installed: 0.24]
    - Jinja2 [required: >=2.10, installed: 2.10]
      - MarkupSafe [required: >=0.23, installed: 1.0]
    - Werkzeug [required: >=0.14, installed: 0.14.1]
Flask-Cors==3.0.6
  - Flask [required: >=0.9, installed: 1.0.2]
    - click [required: >=5.1, installed: 6.7]
    - itsdangerous [required: >=0.24, installed: 0.24]
    - Jinja2 [required: >=2.10, installed: 2.10]
      - MarkupSafe [required: >=0.23, installed: 1.0]
    - Werkzeug [required: >=0.14, installed: 0.14.1]
  - Six [required: Any, installed: 1.11.0]
Flask-PyMongo==2.1.0
  - Flask [required: >=0.11, installed: 1.0.2]
    - click [required: >=5.1, installed: 6.7]
    - itsdangerous [required: >=0.24, installed: 0.24]
    - Jinja2 [required: >=2.10, installed: 2.10]
      - MarkupSafe [required: >=0.23, installed: 1.0]
    - Werkzeug [required: >=0.14, installed: 0.14.1]
  - PyMongo [required: >=3.0, installed: 3.7.1]
Flask-RESTful==0.3.6
  - aniso8601 [required: >=0.82, installed: 3.0.2]
  - Flask [required: >=0.8, installed: 1.0.2]
    - click [required: >=5.1, installed: 6.7]
    - itsdangerous [required: >=0.24, installed: 0.24]
    - Jinja2 [required: >=2.10, installed: 2.10]
      - MarkupSafe [required: >=0.23, installed: 1.0]
    - Werkzeug [required: >=0.14, installed: 0.14.1]
  - pytz [required: Any, installed: 2018.5]
  - six [required: >=1.3.0, installed: 1.11.0]
gunicorn==19.9.0
openpyxl==2.5.5
  - et-xmlfile [required: Any, installed: 1.0.1]
  - jdcal [required: Any, installed: 1.4]
PyMySQL==0.9.2
  - cryptography [required: Any, installed: 2.3.1]
    - asn1crypto [required: >=0.21.0, installed: 0.24.0]
    - cffi [required: >=1.7,!=1.11.3, installed: 1.11.5]
      - pycparser [required: Any, installed: 2.18]
    - idna [required: >=2.1, installed: 2.7]
    - six [required: >=1.4.1, installed: 1.11.0]
python-dotenv==0.9.1
redis==2.10.6
requests==2.19.1
  - certifi [required: >=2017.4.17, installed: 2018.8.13]
  - chardet [required: >=3.0.2,<3.1.0, installed: 3.0.4]
  - idna [required: >=2.5,<2.8, installed: 2.7]
  - urllib3 [required: >=1.21.1,<1.24, installed: 1.23]
graph中果然还是没有numpy
1
2
3
4
5
6
7
8
9
10
11
12
13
➜  xxxRobotDemoServer git:(master) ✗ pipenv install
Pipfile.lock (512a06) out of date, updating to (ab35a7)...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
 
Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
Could not find a version that matches botocore<1.11.0,<1.12.0,<2.0.0,==1.10.84,>=1.10.77,>=1.11.1,>=1.3.0
Tried: 0.4.1, 0.4.2, 0.5.0, 0.5.1, ......... 1.11.1
Skipped pre-versions: 1.0.0a1, 1.0.0a2, 1.0.0a3, 1.0.0b1, 1.0.0b2, 1.0.0b3, 1.0.0rc1, 1.0.0rc1
There are incompatible versions in the resolved dependencies.
...
install还是没有安装新加入的库
updated Pipfile how pipenv install
Basic Usage of Pipenv — pipenv 2018.7.1.dev0 documentation
试试pipenv update:
1
2
3
4
➜  xxxRobotDemoServer git:(master) ✗ pipenv update
Running $ pipenv lock then $ pipenv sync.
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
估计还是不行。
果然不行。
猜测是:Pipenv在进入虚拟环境后,无法检测到Pipfile的更新和改动
所以去试试:关闭终端,重新打开,或许pipenv就可以检测到改动了。
重新打开:
1
2
3
➜  xxxRobotDemoServer git:(master) ✗ pipenv sync
Installing dependencies from Pipfile.lock (512a06)...
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 31/35 — 00:00:04
这下看着比较正常,感觉是去安装新加入的库了
1
2
3
4
5
Installing dependencies from Pipfile.lock (512a06)...
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 35/35 — 00:00:12
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
All dependencies are now up-to-date!
结果还是不行。
删除掉pipfile.lock
然后再去install试试
1
2
3
4
5
6
7
8
9
10
11
12
13
14
➜  xxxRobotDemoServer git:(master) ✗ pipenv install
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
 
Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
Could not find a version that matches botocore<1.11.0,<1.12.0,<2.0.0,==1.10.84,>=1.10.77,>=1.11.1,>=1.3.0
Tried: 0.4.1, 0.4.2, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.6.0, 0.7.
...
83, 1.10.84, 1.10.84, 1.11.0, 1.11.0, 1.11.1, 1.11.1
Skipped pre-versions: 1.0.0a1, 1.0.0a2, 1.0.0a3, 1.0.0b1, 1.0.0b2, 1.0.0b3, 1.0.0rc1, 1.0.0rc1
There are incompatible versions in the resolved dependencies.
问题依旧。
再去,换用iTerm,不用PyCharm的终端了,结果问题依旧。
感觉只能是:
pipenv install lib1 lib2 lib3
这种方式去安装才行了
1
pipenv install numpy schedule pylru jieba pycnnum solrclient gensim patchwork tqdm
安装完毕:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
➜  xxxRobotDemoServer git:(master) ✗ pipenv install numpy schedule pylru jieba pycnnum solrclient gensim patchwork tqdm
Installing numpy...
Looking in indexes:
https://pypi.tuna.tsinghua.edu.cn/simple
Collecting numpy
  Downloading
https://pypi.tuna.tsinghua.edu.cn/packages/a6/0a/2defbdd9bd3a436ee0642bb8d8a66d16e523122d33384a04548dcfab23ba/numpy-1.15.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
 (24.5MB)
Installing collected packages: numpy
Successfully installed numpy-1.15.1
 
Adding numpy to Pipfile's [packages]...
Installing schedule...
Looking in indexes:
Collecting schedule
  Using cached
Installing collected packages: schedule
Successfully installed schedule-0.5.0
 
Adding schedule to Pipfile's [packages]...
Installing pylru...
Looking in indexes:
https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pylru
  Downloading
https://pypi.tuna.tsinghua.edu.cn/packages/2e/6f/7533e986bed3ec224f02d913f34ab6e110fb0286795c1f6e18e66e03a9f0/pylru-1.1.0.tar.gz
Building wheels for collected packages: pylru
  Running setup.py bdist_wheel for pylru: started
  Running setup.py bdist_wheel for pylru: finished with status 'done'
  Stored in directory: /Users/crifan/Library/Caches/pipenv/wheels/74/7a/79/aeaa108d68d8684980c129747875ab3bd541dbb2a9d2bc6c88
Successfully built pylru
Installing collected packages: pylru
Successfully installed pylru-1.1.0
 
Adding pylru to Pipfile's [packages]...
Installing jieba...
Looking in indexes:
Collecting jieba
Installing collected packages: jieba
Successfully installed jieba-0.39
 
Adding jieba to Pipfile's [packages]...
Installing pycnnum...
Looking in indexes:
https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pycnnum
  Using cached
https://pypi.tuna.tsinghua.edu.cn/packages/dd/42/ca3efad36831c0123ea6fa147020f50e3f478ed26fcfcce6101e201f11fb/pycnnum-1.0.1-py3-none-any.whl
Installing collected packages: pycnnum
Successfully installed pycnnum-1.0.1
 
Adding pycnnum to Pipfile's [packages]...
Installing solrclient...
Looking in indexes:
Collecting solrclient
Requirement already satisfied: requests>=2.2.1 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from solrclient) (2.19.1)
Collecting kazoo==2.2.1 (from solrclient)
  Using cached
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from requests>=2.2.1->solrclient) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from requests>=2.2.1->solrclient) (2018.8.13)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from requests>=2.2.1->solrclient) (1.23)
Requirement already satisfied: idna<2.8,>=2.5 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from requests>=2.2.1->solrclient) (2.7)
Requirement already satisfied: six in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from kazoo==2.2.1->solrclient) (1.11.0)
Installing collected packages: kazoo, solrclient
Successfully installed kazoo-2.2.1 solrclient-0.2.1
 
Adding solrclient to Pipfile's [packages]...
Installing gensim...
Looking in indexes:
https://pypi.tuna.tsinghua.edu.cn/simple
Collecting gensim
  Using cached
https://pypi.tuna.tsinghua.edu.cn/packages/cb/d9/f5adaf1108aad2b3d32a11aceede54faa5da9dbf962e9bcff759e1d27bd3/gensim-3.5.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting smart-open>=1.2.1 (from gensim)
Requirement already satisfied: six>=1.5.0 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from gensim) (1.11.0)
Requirement already satisfied: numpy>=1.11.3 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from gensim) (1.15.1)
Collecting scipy>=0.18.1 (from gensim)
  Using cached
https://pypi.tuna.tsinghua.edu.cn/packages/a0/b6/70bf61c1badb5fea82d4c558e05e76c2dee5e77bb072fe465d7c7a87287d/scipy-1.1.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting boto>=2.32 (from smart-open>=1.2.1->gensim)
  Using cached
https://pypi.tuna.tsinghua.edu.cn/packages/23/10/c0b78c27298029e4454a472a1919bde20cb182dab1662cec7f2ca1dcc523/boto-2.49.0-py2.py3-none-any.whl
Requirement already satisfied: requests in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from smart-open>=1.2.1->gensim) (2.19.1)
Collecting bz2file (from smart-open>=1.2.1->gensim)
Collecting boto3 (from smart-open>=1.2.1->gensim)
  Downloading
https://pypi.tuna.tsinghua.edu.cn/packages/d6/bc/5393e095b03e871055efae27bac7d314c7f62ab05fea098441052c2afdbb/boto3-1.8.1-py2.py3-none-any.whl
 (128kB)
Requirement already satisfied: idna<2.8,>=2.5 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from requests->smart-open>=1.2.1->gensim) (2.7)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from requests->smart-open>=1.2.1->gensim) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from requests->smart-open>=1.2.1->gensim) (2018.8.13)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from requests->smart-open>=1.2.1->gensim) (1.23)
Collecting botocore<1.12.0,>=1.11.1 (from boto3->smart-open>=1.2.1->gensim)
  Downloading
https://pypi.tuna.tsinghua.edu.cn/packages/53/fe/eb019c3d0fecc26680f025af10f3f026c33b61fda6c349de931e589ffa80/botocore-1.11.1-py2.py3-none-any.whl
 (4.6MB)
Collecting s3transfer<0.2.0,>=0.1.10 (from boto3->smart-open>=1.2.1->gensim)
  Using cached
https://pypi.tuna.tsinghua.edu.cn/packages/d7/14/2a0004d487464d120c9fb85313a75cd3d71a7506955be458eebfe19a6b1d/s3transfer-0.1.13-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from boto3->smart-open>=1.2.1->gensim)
  Using cached
https://pypi.tuna.tsinghua.edu.cn/packages/b7/31/05c8d001f7f87f0f07289a5fc0fc3832e9a57f2dbd4d3b0fee70e0d51365/jmespath-0.9.3-py2.py3-none-any.whl
Collecting docutils>=0.10 (from botocore<1.12.0,>=1.11.1->boto3->smart-open>=1.2.1->gensim)
  Using cached
https://pypi.tuna.tsinghua.edu.cn/packages/36/fa/08e9e6e0e3cbd1d362c3bbee8d01d0aedb2155c4ac112b19ef3cae8eed8d/docutils-0.14-py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1; python_version >= "2.7" (from botocore<1.12.0,>=1.11.1->boto3->smart-open>=1.2.1->gensim)
  Using cached
https://pypi.tuna.tsinghua.edu.cn/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl
Installing collected packages: boto, bz2file, docutils, python-dateutil, jmespath, botocore, s3transfer, boto3, smart-open, scipy, gensim
Successfully installed boto-2.49.0 boto3-1.8.1 botocore-1.11.1 bz2file-0.98 docutils-0.14 gensim-3.5.0 jmespath-0.9.3 python-dateutil-2.7.3 s3transfer-0.1.13 scipy-1.1.0 smart-open-1.6.0
 
Adding gensim to Pipfile's [packages]...
Installing patchwork...
Looking in indexes:
Collecting patchwork
  Downloading
Requirement already satisfied: fabric<3.0,>=2.0 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from patchwork) (2.3.1)
Requirement already satisfied: cryptography>=1.1 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from fabric<3.0,>=2.0->patchwork) (2.3.1)
Requirement already satisfied: invoke<2.0,>=1.1 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from fabric<3.0,>=2.0->patchwork) (1.1.1)
Requirement already satisfied: paramiko>=2.4 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from fabric<3.0,>=2.0->patchwork) (2.4.1)
Requirement already satisfied: cffi!=1.11.3,>=1.7 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from cryptography>=1.1->fabric<3.0,>=2.0->patchwork) (1.11.5)
Requirement already satisfied: six>=1.4.1 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from cryptography>=1.1->fabric<3.0,>=2.0->patchwork) (1.11.0)
Requirement already satisfied: asn1crypto>=0.21.0 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from cryptography>=1.1->fabric<3.0,>=2.0->patchwork) (0.24.0)
Requirement already satisfied: idna>=2.1 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from cryptography>=1.1->fabric<3.0,>=2.0->patchwork) (2.7)
Requirement already satisfied: pynacl>=1.0.1 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from paramiko>=2.4->fabric<3.0,>=2.0->patchwork) (1.2.1)
Requirement already satisfied: bcrypt>=3.1.3 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from paramiko>=2.4->fabric<3.0,>=2.0->patchwork) (3.1.4)
Requirement already satisfied: pyasn1>=0.1.7 in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from paramiko>=2.4->fabric<3.0,>=2.0->patchwork) (0.4.4)
Requirement already satisfied: pycparser in /Users/crifan/.local/share/virtualenvs/xxxRobotDemoServer-SCpLPEyZ/lib/python3.6/site-packages (from cffi!=1.11.3,>=1.7->cryptography>=1.1->fabric<3.0,>=2.0->patchwork) (2.18)
Installing collected packages: patchwork
Successfully installed patchwork-1.0.1
 
Adding patchwork to Pipfile's [packages]...
Installing tqdm...
Looking in indexes:
https://pypi.tuna.tsinghua.edu.cn/simple
Collecting tqdm
  Downloading
https://pypi.tuna.tsinghua.edu.cn/packages/c7/e0/52b2faaef4fd87f86eb8a8f1afa2cd6eb11146822033e29c04ac48ada32c/tqdm-4.25.0-py2.py3-none-any.whl
 (43kB)
Installing collected packages: tqdm
Successfully installed tqdm-4.25.0
 
Adding tqdm to Pipfile's [packages]...
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
 
Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
Could not find a version that matches botocore<1.11.0,<1.12.0,<2.0.0,==1.10.84,>=1.10.77,>=1.11.1,>=1.3.0
Tried: 0.4.1, 0.4.2,........, 1.11.0, 1.11.0, 1.11.1, 1.11.1
Skipped pre-versions: 1.0.0a1, 1.0.0a2, 1.0.0a3, 1.0.0b1, 1.0.0b2, 1.0.0b3, 1.0.0rc1, 1.0.0rc1
There are incompatible versions in the resolved dependencies.
 
➜  xxxRobotDemoServer git:(master) ✗
然后再去运行看看
就可以了。
【总结】
pipenv的Pipfile中,手动在
[packages]
部分加入了要安装的库,比如:
1
2
3
4
5
6
7
8
9
10
11
[packages]
..
numpy = "*"
schedule = "*"
pylru = "*"
jieba = "*"
pycnnum = "*"
solrclient = "*"
gensim = "*"
patchwork = "*"
tqdm = "*"
结果:
希望,以为,pipenv直接去install或update或sync,可以自动检测到新加入的库,并自动安装,结果是不行的。
只能手动的去:
pipenv install numpy jieba xxx
才可以安装
-》看来pipenv还是不够智能。
只能算是继续凑合用吧。

转载请注明:在路上 » 【已解决】pipenv如何安装更新了的Pipfile中的库

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
97 queries in 0.275 seconds, using 22.27MB memory