在 python 3.5.2 windows 10 上安装 picamera 时出错

问题描述 投票:0回答:4

我尝试使用 pip 9 将 picamera 安装到 Windows 10 上的 python 3.5 上。

另外,我上网查了一下,知道我需要安装 pyyaml,我就这么做了。这真的很奇怪,有人建议 pip 需要与 setup.py 位于同一位置?这更令人困惑。无论如何,以下是我所做的,希望对您有所帮助。

执行的命令:

pip install --user picamera

命令输出:

Collecting picamera
  Using cached picamera-1.13.tar.gz
Building wheels for collected packages: picamera
  Running setup.py bdist_wheel for picamera: started
  Running setup.py bdist_wheel for picamera: finished with status 'error'
  Complete output from command C:\Users\Dell\AppData\Local\Programs\Python\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Dell\\AppData\\Local\\Temp\\pycharm-packaging\\picamera\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\Dell\AppData\Local\Temp\tmpfj3othpnpip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib
  creating build\lib\picamera
  copying picamera\array.py -> build\lib\picamera
  copying picamera\bcm_host.py -> build\lib\picamera
  copying picamera\camera.py -> build\lib\picamera
  copying picamera\color.py -> build\lib\picamera
  copying picamera\display.py -> build\lib\picamera
  copying picamera\encoders.py -> build\lib\picamera
  copying picamera\exc.py -> build\lib\picamera
  copying picamera\frames.py -> build\lib\picamera
  copying picamera\mmal.py -> build\lib\picamera
  copying picamera\mmalobj.py -> build\lib\picamera
  copying picamera\renderers.py -> build\lib\picamera
  copying picamera\streams.py -> build\lib\picamera
  copying picamera\__init__.py -> build\lib\picamera
  running egg_info
  writing picamera.egg-info\PKG-INFO
  writing requirements to picamera.egg-info\requires.txt
  writing dependency_links to picamera.egg-info\dependency_links.txt
  writing top-level names to picamera.egg-info\top_level.txt
  warning: manifest_maker: standard file '-c' not found

  reading manifest file 'picamera.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'debian'
  no previously-included directories found matching 'docs'
  writing manifest file 'picamera.egg-info\SOURCES.txt'
  warning: build_py: byte-compiling is disabled, skipping.

  installing to build\bdist.win-amd64\wheel
  running install
  Traceback (most recent call last):
    File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 101, in run
      with io.open('/proc/cpuinfo', 'r') as cpuinfo:
  FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 145, in <module>
      main()
    File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 140, in main
      cmdclass             = {'install': CustomInstallCommand},
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\Dell\AppData\Roaming\Python\Python35\site-packages\wheel\bdist_wheel.py", line 240, in run
      self.run_command('install')
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 113, in run
      raise ValueError('Unable to open /proc/cpuinfo')
  ValueError: Unable to open /proc/cpuinfo

  ----------------------------------------
  Running setup.py clean for picamera
Failed to build picamera
Installing collected packages: picamera
  Running setup.py install for picamera: started
    Running setup.py install for picamera: finished with status 'error'
    Complete output from command C:\Users\Dell\AppData\Local\Programs\Python\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Dell\\AppData\\Local\\Temp\\pycharm-packaging\\picamera\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Dell\AppData\Local\Temp\pip-x3ancwkq-record\install-record.txt --single-version-externally-managed --compile --user --prefix=:
    running install
    Traceback (most recent call last):
      File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 101, in run
        with io.open('/proc/cpuinfo', 'r') as cpuinfo:
    FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 145, in <module>
        main()
      File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 140, in main
        cmdclass             = {'install': CustomInstallCommand},
      File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 113, in run
        raise ValueError('Unable to open /proc/cpuinfo')
    ValueError: Unable to open /proc/cpuinfo

    ----------------------------------------

  Failed building wheel for picamera
Command "C:\Users\Dell\AppData\Local\Programs\Python\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Dell\\AppData\\Local\\Temp\\pycharm-packaging\\picamera\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Dell\AppData\Local\Temp\pip-x3ancwkq-record\install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\

发生错误:

FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'

尝试用pycharm安装,但还是不行

python
4个回答
6
投票

FileNotFoundError:[Errno 2]没有这样的文件或目录:'/proc/cpuinfo'

因为该文件只存在于linux或类unix系统中,不存在于Windows系统或mac系统中。这就是为什么你无法安装成功的原因。


3
投票

我在使用 Kivy 和 python 时遇到了同样的问题

收到错误消息“未找到名为 picamera 的模块”

帮助我解决这个问题的解决方案:

pip install opencv-python

是的。!它对我有帮助,可能对你有用。

编辑:我在Python 3.7(操作系统:Windows 10)上尝试过这个


0
投票

虽然它很旧,但可能对遇到同样问题的人有用。 步骤。

  1. 打开终端(如果您有虚拟环境,请激活它)
  2. 输入“设置 READTHEDOCS=True”
  3. pip 安装 picamera 或者 4.pip安装picamera[数组]

0
投票

我尝试使用 pip install picamera 安装并安装了它,但这与 picamerazero 不同吗?或者说它们本质上是一样的?

我在尝试安装 picamerazero 时也遇到错误。它说如下:

"× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
    This module only works on linux
     [end of output]"

我也在尝试在 Windows 计算机上下载。

© www.soinside.com 2019 - 2024. All rights reserved.