Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3143|回复: 0
打印 上一主题 下一主题

Python通过pip安装 相关模块

[复制链接]

1272

主题

2067

帖子

7962

积分

认证用户组

Rank: 5Rank: 5

积分
7962
跳转到指定楼层
楼主
发表于 2020-12-19 22:00:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Qter 于 2020-12-20 00:16 编辑

下面方式安装的包,都在这个位置
  1. C:\Users\Administrator\AppData\Local\Programs\Python\Python39\Lib\site-packages
复制代码
Python通过pip安装拼音包
pip install xpinyin
Collecting xpinyin
  Downloading xpinyin-0.7.4-py3-none-any.whl (130 kB)
     |████████████████████████████████| 130 kB 23 kB/s
Installing collected packages: xpinyin
Successfully installed xpinyin-0.7.4


安装视频编辑模块
  1. C:\Users\Administrator>pip install moviepy
  2. Collecting moviepy
  3.   Downloading moviepy-1.0.3.tar.gz (388 kB)
  4.      |████████████████████████████████| 388 kB 9.3 kB/s
  5. Collecting decorator<5.0,>=4.0.2
  6.   Downloading decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
  7. Collecting tqdm<5.0,>=4.11.2
  8.   Downloading tqdm-4.54.1-py2.py3-none-any.whl (69 kB)
  9.      |████████████████████████████████| 69 kB 9.5 kB/s
  10. Collecting requests<3.0,>=2.8.1
  11.   Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
  12.      |████████████████████████████████| 61 kB 6.0 kB/s
  13. Collecting proglog<=1.0.0
  14.   Downloading proglog-0.1.9.tar.gz (10 kB)
  15. ERROR: Could not find a version that satisfies the requirement numpy>=1.17.3 (from moviepy) (from versions: none)
  16. ERROR: No matching distribution found for numpy>=1.17.3 (from moviepy)
  17. WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
  18. You should consider upgrading via the 'c:\users\administrator\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
复制代码
上面出错,先安装一下 proglog
  1. C:\Users\Administrator>pip install  proglog
  2. Collecting proglog
  3.   Using cached proglog-0.1.9.tar.gz (10 kB)
  4. Collecting tqdm
  5.   Using cached tqdm-4.54.1-py2.py3-none-any.whl (69 kB)
  6. Using legacy 'setup.py install' for proglog, since package 'wheel' is not installed.
  7. Installing collected packages: tqdm, proglog
  8.     Running setup.py install for proglog ... done
  9. Successfully installed proglog-0.1.9 tqdm-4.54.1
  10. WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
  11. You should consider upgrading via the 'c:\users\administrator\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
复制代码
再重新安装一下
  1. C:\Users\Administrator>pip install moviepy
  2. Collecting moviepy
  3.   Using cached moviepy-1.0.3.tar.gz (388 kB)
  4. Collecting decorator<5.0,>=4.0.2
  5.   Using cached decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
  6. Requirement already satisfied: tqdm<5.0,>=4.11.2 in c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages (from moviepy) (4.54.1)
  7. Collecting requests<3.0,>=2.8.1
  8.   Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
  9. Requirement already satisfied: proglog<=1.0.0 in c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages (from moviepy) (0.1.9)
  10. Collecting numpy>=1.17.3
  11.   Downloading numpy-1.19.4-cp39-cp39-win_amd64.whl (13.0 MB)
  12.      |████████████████████████████████| 13.0 MB 46 kB/s
  13. Collecting imageio<3.0,>=2.5
  14.   Downloading imageio-2.9.0-py3-none-any.whl (3.3 MB)
  15.      |████████████████████████████████| 3.3 MB 31 kB/s
  16. Collecting imageio_ffmpeg>=0.2.0
  17.   Downloading imageio_ffmpeg-0.4.2-py3-none-win_amd64.whl (22.6 MB)
  18.      |████████████████████████████████| 22.6 MB 51 kB/s
  19. Collecting certifi>=2017.4.17
  20.   Downloading certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
  21.      |████████████████████████████████| 147 kB 53 kB/s
  22. Collecting chardet<5,>=3.0.2
  23.   Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
  24.      |████████████████████████████████| 178 kB 60 kB/s
  25. Collecting urllib3<1.27,>=1.21.1
  26.   Downloading urllib3-1.26.2-py2.py3-none-any.whl (136 kB)
  27.      |████████████████████████████████| 136 kB 73 kB/s
  28. Collecting idna<3,>=2.5
  29.   Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
  30.      |████████████████████████████████| 58 kB 47 kB/s
  31. Collecting pillow
  32.   Downloading Pillow-8.0.1-cp39-cp39-win_amd64.whl (2.1 MB)
  33.      |████████████████████████████████| 2.1 MB 30 kB/s
  34. Using legacy 'setup.py install' for moviepy, since package 'wheel' is not installed.
  35. Installing collected packages: decorator, certifi, chardet, urllib3, idna, requests, numpy, pillow, imageio, imageio-ffmpeg, moviepy
  36.     Running setup.py install for moviepy ... done
  37. Successfully installed certifi-2020.12.5 chardet-4.0.0 decorator-4.4.2 idna-2.10 imageio-2.9.0 imageio-ffmpeg-0.4.2 moviepy-1.0.3 numpy-1.19.4 pillow-8.0.1 requests-2.25.1 urllib3-1.26.2
  38. WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
  39. You should consider upgrading via the 'c:\users\administrator\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
复制代码
运行程序,还是会报如下错误
  1. python getFiles.py
  2. ** On entry to DGEBAL parameter number  3 had an illegal value
  3. ** On entry to DGEHRD  parameter number  2 had an illegal value
  4. ** On entry to DORGHR DORGQR parameter number  2 had an illegal value
  5. ** On entry to DHSEQR parameter number  4 had an illegal value
  6. Traceback (most recent call last):
  7.   File "D:\github\he_chengjin_outlook\Meedu\meedu\二次开发\getFiles.py", line 5, in <module>
  8.     from moviepy.editor import VideoFileClip
  9.   File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\editor.py", line 24, in <module>
  10.     import imageio
  11.   File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\imageio\__init__.py", line 22, in <module>
  12.     from .core import FormatManager, RETURN_BYTES
  13.   File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\imageio\core\__init__.py", line 10, in <module>
  14.     from .util import Image, Array, Dict, asarray, image_as_uint, urlopen
  15.   File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\imageio\core\util.py", line 19, in <module>
  16.     import numpy as np
  17.   File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\numpy\__init__.py", line 305, in <module>
  18.     _win_os_check()
  19.   File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\numpy\__init__.py", line 302, in _win_os_check
  20.     raise RuntimeError(msg.format(__file__)) from None
  21. RuntimeError: The current Numpy installation ('C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https://tinyurl.com/y3dm3h86
复制代码
报错原因:
1、使用python3.9和numpy1.19.4时会发生此错误
2、numpy 1.19.4所有Python版本都无法执行的错误。使用以前的版本来解决该问题(版本问题

查看版本信息
  1. C:\Users\Administrator>pip show numpy
  2. Name: numpy
  3. Version: 1.19.4
  4. Summary: NumPy is the fundamental package for array computing with Python.
  5. Home-page: https://www.numpy.org
  6. Author: Travis E. Oliphant et al.
  7. Author-email: None
  8. License: BSD
  9. Location: c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages
  10. Requires:
  11. Required-by: moviepy, imageio
复制代码


查看有哪些版本可用
  1. C:\Users\Administrator>pip install numpy==
  2. WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/numpy/
  3. ERROR: Could not find a version that satisfies the requirement numpy== (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0b3, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.11.1rc1, 1.11.1, 1.11.2rc1, 1.11.2, 1.11.3, 1.12.0b1, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.1rc1, 1.12.1, 1.13.0rc1, 1.13.0rc2, 1.13.0, 1.13.1, 1.13.3, 1.14.0rc1, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0rc1, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0rc1, 1.16.0rc2, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0rc1, 1.17.0rc2, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0rc1, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0rc1, 1.19.0rc2, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20.0rc1)
  4. ERROR: No matching distribution found for numpy==
复制代码
安装最新版本试试

  1. C:\Users\Administrator>pip install numpy==1.20.0rc1
  2. Collecting numpy==1.20.0rc1
  3.   Downloading numpy-1.20.0rc1-cp39-cp39-win_amd64.whl (13.7 MB)
  4.      |████████████████████████████████| 13.7 MB 6.4 MB/s
  5. Installing collected packages: numpy
  6.   Attempting uninstall: numpy
  7.     Found existing installation: numpy 1.19.4
  8.     Uninstalling numpy-1.19.4:
  9.       Successfully uninstalled numpy-1.19.4
  10. Successfully installed numpy-1.20.0rc1
复制代码

成功,对不是视频的文件要过滤一下



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|firemail ( 粤ICP备15085507号-1 )

GMT+8, 2024-11-25 20:58 , Processed in 0.059026 second(s), 20 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表