pipenv 安装 dotenv 安装出现错误,无法安装,求大神帮忙,感谢!

我的系统是win7的,python的版本是3.7.1 用pipenv安装虚拟环境和flask都没问题,但是dotenv死活安装不了,一直报错!

-------------------------------------- 这是报错内容 ---------------------------------------------
D:\jinja2>pipenv install dotenv
Installing dotenv…
Adding dotenv to Pipfile’s [packages]…
Installation Succeeded
Pipfile.lock (50dd4e) out of date, updating to (662286)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Locking Failed!
Traceback (most recent call last):
File “c:/users/administrator/appdata/local/programs/python/python37-32/lib/sit
e-packages/pipenv/resolver.py”, line 126, in
main()
File “c:/users/administrator/appdata/local/programs/python/python37-32/lib/sit
e-packages/pipenv/resolver.py”, line 119, in main
parsed.requirements_dir, parsed.packages)
File “c:/users/administrator/appdata/local/programs/python/python37-32/lib/sit
e-packages/pipenv/resolver.py”, line 85, in _main
requirements_dir=requirements_dir,
File “c:/users/administrator/appdata/local/programs/python/python37-32/lib/sit
e-packages/pipenv/resolver.py”, line 69, in resolve
req_dir=requirements_dir
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\utils.py”, line 726, in resolve_deps
req_dir=req_dir,
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\utils.py”, line 480, in actually_resolve_deps
resolved_tree = resolver.resolve()
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\utils.py”, line 385, in resolve
results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\resolver.py”, line 102, in resolve
has_changed, best_matches = self._resolve_one_round()
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\resolver.py”, line 206, in _resolve_one_round

for dep in self._iter_dependencies(best_match):

File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\resolver.py”, line 301, in _iter_dependencies

dependencies = self.repository.get_dependencies(ireq)

File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\repositories\pypi.py”, line 234, in get_depen
dencies
legacy_results = self.get_legacy_dependencies(ireq)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\repositories\pypi.py”, line 426, in get_legac
y_dependencies
results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\repositories\pypi.py”, line 297, in resolve_r
eqs
results = resolver._resolve_one(reqset, ireq)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\resolve.py”, line 260, in _resolve_on
e
abstract_dist = self._get_abstract_dist_for(req_to_install)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\resolve.py”, line 213, in _get_abstra
ct_dist_for
self.require_hashes
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\operations\prepare.py”, line 294, in
prepare_linked_requirement
abstract_dist.prep_for_dist(finder, self.build_isolation)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\operations\prepare.py”, line 127, in
prep_for_dist
self.req.run_egg_info()
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\req\req_install.py”, line 474, in run
_egg_info
command_desc=‘python setup.py egg_info’)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\utils\misc.py”, line 705, in call_sub
process
% (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command “python se
tup.py egg_info” failed with error code 1 in C:\Users\ADMINI~1\AppData\Local\Tem
p\tmprdqavkeebuild\dotenv
File “c:/users/administrator/appdata/local/programs/python/python37-32/lib/site-
packages/pipenv/resolver.py”, line 126, in
main()
File “c:/users/administrator/appdata/local/programs/python/python37-32/lib/sit
e-packages/pipenv/resolver.py”, line 119, in main
parsed.requirements_dir, parsed.packages)
File “c:/users/administrator/appdata/local/programs/python/python37-32/lib/sit
e-packages/pipenv/resolver.py”, line 85, in _main
requirements_dir=requirements_dir,
File “c:/users/administrator/appdata/local/programs/python/python37-32/lib/sit
e-packages/pipenv/resolver.py”, line 69, in resolve
req_dir=requirements_dir
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\utils.py”, line 726, in resolve_deps
req_dir=req_dir,
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\utils.py”, line 480, in actually_resolve_deps
resolved_tree = resolver.resolve()
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\utils.py”, line 385, in resolve
results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\resolver.py”, line 102, in resolve
has_changed, best_matches = self._resolve_one_round()
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\resolver.py”, line 206, in _resolve_one_round

for dep in self._iter_dependencies(best_match):

File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\resolver.py”, line 301, in _iter_dependencies

dependencies = self.repository.get_dependencies(ireq)

File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\repositories\pypi.py”, line 234, in get_depen
dencies
legacy_results = self.get_legacy_dependencies(ireq)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\repositories\pypi.py”, line 426, in get_legac
y_dependencies
results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\piptools\repositories\pypi.py”, line 297, in resolve_r
eqs
results = resolver._resolve_one(reqset, ireq)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\resolve.py”, line 260, in _resolve_on
e
abstract_dist = self._get_abstract_dist_for(req_to_install)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\resolve.py”, line 213, in _get_abstra
ct_dist_for
self.require_hashes
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\operations\prepare.py”, line 294, in
prepare_linked_requirement
abstract_dist.prep_for_dist(finder, self.build_isolation)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\operations\prepare.py”, line 127, in
prep_for_dist
self.req.run_egg_info()
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\req\req_install.py”, line 474, in run
_egg_info
command_desc=‘python setup.py egg_info’)
File “c:\users\administrator\appdata\local\programs\python\python37-32\lib\sit
e-packages\pipenv\patched\notpip_internal\utils\misc.py”, line 705, in call_sub
process
% (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command “python se
tup.py egg_info” failed with error code 1 in C:\Users\ADMINI~1\AppData\Local\Tem
p\tmprdqavkeebuild\dotenv\

D:\jinja2>

------------------------------------- 这是用PyCharm 安装时的报错 ------------------------------------------

PyCharm Project Interpreter 中也未检测到 dotenv
求各位大神指导,dotenv改如何安装?

请把命令行文本或代码用代码块格式化一下 。

插入代码块的方式:除了将所有代码缩进四格,更方便的插入代码块方式是使用三个连续的反引号作为开始和结束标记,比如:

```
def hello():
    return ‘Hello World’
```

会被渲染为:

 def hello():
     return 'Hello World'

具体参考论坛说明

1 个赞

看了下 https://pypi.org/project/python-dotenv/ pipenv支持的Python的版本,没有3.7。要不你用回Python36试试:smirk::smirk::smirk:

Python太新了。

$ pipenv install python-dotenv

注意拼写。

另外,请参考上上条回复改进你的正文。

1 个赞

想起来了!dotenv正确安装命令是

pip install python-dotenv

安装包名称是python-dotenv不是dotenv

谢谢大神指导,但是还是没解决啊:
我把python降级到3.6.7了,也在全局安装了 python-dotenv,按时在虚拟环境中安装的时候,安装到时安装成功了,但是提示无法锁定:
--------------------------------------- 错误提示 ----------------------------------------------

jing@ubuntu:~/jinja2$ pipenv install python-dotenv
Installing python-dotenv…
Adding python-dotenv to Pipfile’s [packages]…
:heavy_check_mark: Installation Succeeded
Pipfile.lock (31ce8c) out of date, updating to (8a3288)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✘ Locking Failed!

求大神指导,感谢!!!

pipenv uninstall python-dotenv之后再重新安装试一下