简体   繁体   English

pip install FileNotFoundError: [Errno 2] 没有这样的文件或目录:

[英]pip install FileNotFoundError: [Errno 2] No such file or directory:

I am trying to install behave-parallel using pip install.我正在尝试使用 pip install 安装行为并行。 I have installed programmes previously using pip so I know my Python/script path is correct in my env variables.我以前使用 pip 安装了程序,所以我知道我的 Python/脚本路径在我的 env 变量中是正确的。 However I am seeing the following error但是我看到以下错误

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\.....Temp\\pip-install-rjiorrn7\\behave-parallel\\setup.py' 

how can I resolve this issue我该如何解决这个问题

C:\Users\.....>pip install behave-parallel
Collecting behave-parallel
 Using cached https://files.pythonhosted.org/packages/05/9d/22f74dd77bc4fa85d391564a232c49b4e99cfdeac7bfdee8151ea4606632/behave-parallel-1.2.4a1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\.........\python\lib\tokenize.py", line 447, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: 'C:\\.........\\AppData\\Local\\Temp\\pip-install-7vgf8_mu\\behave-parallel\\setup.py'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\.........\AppData\Local\Temp\pip-install-7vgf8_mu\behave-parallel\

In my case with the same error, the solution was to do在我遇到相同错误的情况下,解决方案是

pip3 install --upgrade pip 

It was my pip3 that was in version 9.X were it's now in version 19.X我的 pip3 在 9.X 版中,现在是 19.X 版

The package is simply broken, as it is missing the setup.py file.该软件包只是损坏了,因为它缺少setup.py文件。

$ tar tzvf behave-parallel-1.2.4a1.tar.gz | grep setup.py
$

You might be able to download the source from Github or wherever and package it yourself ( python setup.py bdist_wheel ), then install that wheel ( pip install ../../dist/behave-parallel...whl ).您可以从 Github 或任何地方下载源代码并python setup.py bdist_wheel打包( python setup.py bdist_wheel ),然后安装该轮子( pip install ../../dist/behave-parallel...whl )。

There is a newer feature for building python packages (see also PEP 517 and PEP 518 ).有一个用于构建 python 包的新功能(另见PEP 517PEP 518 )。 A package can now be built without setup.py (with pyproject.toml), but older pip versions are not aware of this feature and raise the error shown in the question.现在可以在没有 setup.py(使用 pyproject.toml)的情况下构建包,但旧的 pip 版本不知道此功能并引发问题中显示的错误。

So if you have reason to believe that the library was packaged properly, try updating pip to something newer ( version 19 or newer will probably work).因此,如果您有理由相信该库已正确打包,请尝试将 pip 更新为更新版本(版本 19 或更新版本可能会工作)。

Here it seems caused by setup.py not being in the root of my project.这里似乎是由 setup.py 不在我的项目的根目录中引起的。 (it can't be in root because otherwise the unit test will "discover" setup.py and fail it because it's not a test) (它不能在 root 中,否则单元测试将“发现” setup.py 并失败,因为它不是测试)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pip 安装 pods 命令在 jupyter 中失败,并出现 FileNotFoundError:[Errno 2] 没有这样的文件或目录:'C:\\tmp\\sods.log' - pip install pods command failed in jupyter with FileNotFoundError: [Errno 2] No such file or directory: 'C:\\tmp\\sods.log' pip安装彩色获取错误-FileNotFoundError:[Errno 2]没有这样的文件或目录:&#39;README.rst&#39; - pip install colored getting error - FileNotFoundError: [Errno 2] No such file or directory: 'README.rst' FileNotFoundError [Errno 2] 没有这样的文件或目录: - FileNotFoundError [Errno 2] No such file or directory: FileNotFoundError: [Errno 2] 没有这样的文件或目录? - FileNotFoundError: [Errno 2] No such file or directory? FileNotFoundError:[Errno 2]没有这样的文件或目录: - FileNotFoundError: [Errno 2] No such file or directory: FileNotFoundError:[错误2]没有这样的文件或目录,但是文件在那里 - FileNotFoundError: [Errno 2] No such file or directory, But the file is there FileNotFoundError: [Errno 2] 没有这样的文件或目录,但有一个文件 - FileNotFoundError: [Errno 2] No such file or directory but there is a file FileNotFoundError: [Errno 2] 没有这样的文件或目录:&#39;ifconfig&#39; - FileNotFoundError: [Errno 2] No such file or directory: 'ifconfig' 错误:FileNotFoundError:[Errno 2] 没有这样的文件或目录 - Bad: FileNotFoundError: [Errno 2] No such file or directory python:FileNotFoundError:[Errno 2]没有这样的文件或目录 - python: FileNotFoundError: [Errno 2] No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM