pip 安装 dotenv 错误代码 1 Windows 10 [英] pip install dotenv error code 1 Windows 10

查看:39
本文介绍了pip 安装 dotenv 错误代码 1 Windows 10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 virtualenv 中并尝试通过 pip 安装运行.我知道代码有效,因为在 virtualenv 之外,这段代码有效.我在 Windows 10 机器上运行.使用 Git Bash 终端或常规命令提示符(已尝试作为管理员和普通用户).我正在努力奔跑pip 安装 dotenv或者python -m pip install dotenv并且两者都不起作用.我收到错误提示

I am in a virtualenv and trying to run through pip installs. I know the code works because outside the virtualenv this code has worked. I am running on a Windows 10 machine. Using the Git Bash terminal or the regular command prompt (have tried as admin and regular user). I am trying to run pip install dotenv or python -m pip install dotenv and neither of the two work. I get the error saying

AttributeError: 模块 'importlib._bootstrap' 没有属性 'SourceFileLoader'在处理上述异常的过程中,另一个发生异常:命令python setup.py egg_info"失败错误代码 1C:\Users\USER~1\AppData\Local\Temp\pip-build-7bbdcnx2\dotenv\

AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader' During handling of the above exception, another exception occurred:Command "python setup.py egg_info" failed with error code 1 in C:\Users\USER~1\AppData\Local\Temp\pip-build-7bbdcnx2\dotenv\

我也尝试过诸如python -m pip install setuptools --upgrade卸载 setuptools 并重新安装.重新启动我的电脑.以及许多其他事情.我不太确定还可以尝试什么(在此之前我已经安装了 flask 并且它有效,我也可以安装其他东西,例如 mitmproxy 作为示例)有任何想法吗?同样,这是一台 Windows 10 机器,我只想为 Python 安装 dotenv(如果重要,请安装 3.6.4 版).谢谢.

I have also tried to do things such as python -m pip install setuptools --upgrade un-install setuptools and install it again. restart my computer. and many other things. I'm not too sure what else to try (i've installed flask before this and it worked, I also can install other things like mitmproxy as an example) Any ideas? Again, this is a Windows 10 machine and I just want to install dotenv for Python (version 3.6.4 if it matters). Thank you.

推荐答案

你应该安装 python-dotenv

pip3 install python-dotenv

pip install python-dotenv

C:\Users\USER>pip3 install python-dotenv
Collecting python-dotenv
  Downloading python_dotenv-0.8.2-py2.py3-none-any.whl
Installing collected packages: python-dotenv
Successfully installed python-dotenv-0.8.2

参考这个问题

这篇关于pip 安装 dotenv 错误代码 1 Windows 10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆