【问题标题】:IOError: [Errno 2] No such file or directory: 'requirements.txt' (no module named c)IOError:[Errno 2] 没有这样的文件或目录:'requirements.txt'(没有名为 c 的模块)
【发布时间】:2019-08-29 20:01:43
【问题描述】:

尝试为 GUI 运行一些代码,如果我将其作为笔记本文件运行,偶尔会起作用(其他时候它会尝试编译但没有任何反应)。

我尝试将其作为 .py 文件运行,但在模块“c”尝试下载但由于“requirements.txt”不存在而失败时出现错误。

我使用 anaconda(gl-env)2.7 作为我的项目解释器,并尝试使用以下方法安装/查找 requirements.txt 文件:

pip install -r requirements.txt

我收到文件/目录不存在的错误。

当我运行我的程序时,这是我得到的错误:

Collecting c
  Downloading https://files.pythonhosted.org/packages/fc/5f/1130c201f3138745970f8de520095a942cdd174e8f84faf04ce77c434d8d/c-0.1.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Tommy\AppData\Local\Temp\pycharm-packaging\c\setup.py", line 6, in <module>
        with open('requirements.txt') as fh:
    IOError: [Errno 2] No such file or directory: 'requirements.txt'

【问题讨论】:

    标签: python python-2.7 tkinter pip anaconda


    【解决方案1】:

    根据此模块的PKG-INFO

            ## Installing
    
            This is a python 3 package, and requires python 3.5.
            To install, type in the terminal:
    
                pip3 install c
    

    看起来你不能在 2.7 中使用它。作为说明,我没有 pip install,我只是跑了

    curl --output c-0.1.0.tar.gz https://files.pythonhosted.org/packages/fc/5f/1130c201f3138745970f8de520095a942cdd174e8f84faf04ce77c434d8d/c-0.1.0.tar.gz
    

    下载 tar 存档

    【讨论】:

    • 我只是很困惑,因为我只是试图使用与 2.7 兼容的 tkinter 运行严格的程序。我不知道 c even 是什么以及为什么要收集它。
    • c 是第三方软件包,从它的文档中引用:“这是一个用于 android 和兼容系统的电池历史分析器”。当您尝试安装 tkinter 时是否安装?
    • 当我下载 pycharm 时,Tkinter 已经作为基础包安装了。我在 pycharm 上使用 jupyter notebook,Tkinter 在那里工作正常,但是当在 .py 文件中运行 tkinter 时,它会抛出关于 C 包的错误。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多