Pip install dotenv, Error 1 Windows 10 Pro

huangapple go评论65阅读模式
英文:

Pip install dotenv, Error 1 Windows 10 Pro

问题

当我运行pip install dotenv时,它显示以下错误 -

收集 dotenv
使用缓存的 dotenv-0.0.5.tar.gz (2.4 kB)
准备元数据 (setup.py) ... 错误
错误:subprocess-exited-with-error
× python setup.py egg_info没有成功运行。
│ 退出代码:1
╰─> [72行输出]
C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer已被弃用。要求应由PEP 517安装程序满足。
warnings.warn(
错误:subprocess-exited-with-error
python setup.py egg_info没有成功运行。
退出代码:1
[17行输出]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 14, in <module>
File "C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\setuptools\__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\setuptools\extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\setuptools\dist.py", line 7, in <module>
from setuptools.command.install import install
File "C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\setuptools\command\__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\setuptools\command\install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\pkg_resources.py", line 1518, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
[end of output]
注意:此错误来自子进程,可能与pip无关。
错误:metadata-generation-failed
× 生成包元数据时遇到错误。
╰─&gt; 请参阅上面的输出。
注意:这是上面提到的包的问题,而不是pip的问题。
提示:详细信息请参见上面。
Traceback (most recent call last):
File "C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\installer.py", line 82, in fetch_build_egg
subprocess.check_call(cmd)
File "C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\Users\ANJUTI~1\AppData\Local\Temp\tmpcq62ekpo', '--quiet', 'distribute']' returned non-zero exit status 1.
上述异常是以下异常的直接原因:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\Anju Tiwari\AppData\Local\Temp\pip-install-j7w9rs9u\dotenv_0f4daa500bef4242bb24b3d9366608eb\setup.py", line 13, in <module>
setup(name='dotenv',
File "C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\__init__.py", line 86, in setup
_install_setup_requires(attrs)
File "C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\__init__.py", line 80, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py", line 875, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\pkg_resources\__init__.py", line 789, in resolve
dist = best[req.key] = env.best_match(
^^^^^^^^^^^^^^^^^^
File "C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\pkg_resources\__init__.py", line 1075, in best_match
return self.obtain(req, installer)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\pkg_resources\__init__.py", line 1087, in obtain
return installer(requirement)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py", line 945, in fetch_build_egg
return fetch_build_egg(self, req)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\installer.py", line 84, in fetch_build_
<details>
<summary>英文:</summary>
When I do pip install dotenv it says this -
`Collecting dotenv
Using cached dotenv-0.0.5.tar.gz (2.4 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
&#215; python setup.py egg_info did not run successfully.
│ exit code: 1
╰─&gt; [72 lines of output]
C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by 
a PEP 517 installer.
warnings.warn(
error: subprocess-exited-with-error
python setup.py egg_info did not run successfully.
exit code: 1
[17 lines of output]
Traceback (most recent call last):
File &quot;&lt;string&gt;&quot;, line 2, in &lt;module&gt;
File &quot;&lt;pip-setuptools-caller&gt;&quot;, line 14, in &lt;module&gt;
File &quot;C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\setuptools\__init__.py&quot;, line 2, in &lt;module&gt;
from setuptools.extension import Extension, Library
File &quot;C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\setuptools\extension.py&quot;, line 5, in &lt;module&gt;
from setuptools.dist import _get_unpatched
File &quot;C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\setuptools\dist.py&quot;, line 7, in &lt;module&gt;
from setuptools.command.install import install
File &quot;C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\setuptools\command\__init__.py&quot;, line 8, in &lt;module&gt;
from setuptools.command import install_scripts
File &quot;C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\setuptools\command\install_scripts.py&quot;, line 3, in &lt;module&gt;
from pkg_resources import Distribution, PathMetadata, ensure_directory
File &quot;C:\Users\Anju Tiwari\AppData\Local\Temp\pip-wheel-xv3lcsr9\distribute_009ecda977a04fb699d5559aac28b737\pkg_resources.py&quot;, line 1518, in &lt;module&gt;
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module &#39;importlib._bootstrap&#39; has no attribute &#39;SourceFileLoader&#39;
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Traceback (most recent call last):
File &quot;C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\installer.py&quot;, line 82, in fetch_build_egg
subprocess.check_call(cmd)
File &quot;C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\subprocess.py&quot;, line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command &#39;[&#39;C:\\Users\\Anju Tiwari\\AppData\\Local\\Programs\\Python\\Python311\\python.exe&#39;, &#39;-m&#39;, &#39;pip&#39;, &#39;--disable-pip-version-check&#39;, &#39;wheel&#39;, &#39;--no-deps&#39;, &#39;-w&#39;, &#39;C:\\Users\\ANJUTI~1\\AppData\\Local\\Temp\\tmpcq62ekpo&#39;, &#39;--quiet&#39;, &#39;distribute&#39;]&#39; returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File &quot;&lt;string&gt;&quot;, line 2, in &lt;module&gt;
File &quot;&lt;pip-setuptools-caller&gt;&quot;, line 34, in &lt;module&gt;
File &quot;C:\Users\Anju Tiwari\AppData\Local\Temp\pip-install-j7w9rs9u\dotenv_0f4daa500bef4242bb24b3d9366608eb\setup.py&quot;, line 13, in &lt;module&gt;
setup(name=&#39;dotenv&#39;,
File &quot;C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\__init__.py&quot;, line 86, in setup
_install_setup_requires(attrs)
File &quot;C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\__init__.py&quot;, line 80, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File &quot;C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py&quot;, line 875, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File &quot;C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\pkg_resources\__init__.py&quot;, line 789, in resolve
dist = best[req.key] = env.best_match(
^^^^^^^^^^^^^^^
File &quot;C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\pkg_resources\__init__.py&quot;, line 1075, in best_match
return self.obtain(req, installer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File &quot;C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\pkg_resources\__init__.py&quot;, line 1087, in obtain
return installer(requirement)
^^^^^^^^^^^^^^^^^^^^^^
File &quot;C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py&quot;, line 945, in fetch_build_egg
return fetch_build_egg(self, req)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File &quot;C:\Users\Anju Tiwari\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\installer.py&quot;, line 84, in fetch_build_egg
raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command &#39;[&#39;C:\\Users\\Anju Tiwari\\AppData\\Local\\Programs\\Python\\Python311\\python.exe&#39;, &#39;-m&#39;, &#39;pip&#39;, &#39;--disable-pip-version-check&#39;, &#39;wheel&#39;, &#39;--no-deps&#39;, &#39;-w&#39;, &#39;C:\\Users\\ANJUTI~1\\AppData\\Local\\Temp\\tmpcq62ekpo&#39;, &#39;--quiet&#39;, &#39;distribute&#39;]&#39; returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
&#215; Encountered error while generating package metadata.
╰─&gt; See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.`
I tried doing `pip install dotenv `but then that error come shown above.  
I also tried doing `pip install -U dotenv `but it didn&#39;t work and the same error came. Can someone please help me fix this?
</details>
# 答案1
**得分**: 14
`pip install python-dotenv` 对我有效。
<details>
<summary>英文:</summary>
`pip install python-dotenv` worked for me. 
</details>

huangapple
  • 本文由 发表于 2023年2月6日 02:37:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/75354617.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定