1.安装opencv: python -m pip install opencv-python
调用时为import cv2
2.要from PIL import Image
安装:conda install pillow
3.标准库:https://www.jb51.net/article/57834.htm
出现错误:
ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: ‘d:\sf\anaconda3\envs\pytorch\lib\site-packages\~5py\defs.cp36-win_amd64.pyd’
Consider using the --user
option or check the permissions.
则在package名称前面加上–user,增加管理员权限
如pip install tensorflow→pip install --user tensorflow
4.一些库对应python版本的安装版本:pypi
5.出现错误:安装h5pyViewer==0.0.1.6时
ERROR: Command errored out with exit status 1:
command: 'D:\sf\Anaconda3\envs\tensorflow\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\26603\\AppData\\Local\\Temp\\pip-install-z809vh8z\\h5pyviewer\\setup.py'"'"'; __file__='"'"'C:\\Users\\26603\\AppData\\Local\\Temp\\pip-install-z809vh8z\\h5pyviewer\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\26603\AppData\Local\Temp\pip-pip-egg-info-306uckpc'
cwd: C:\Users\26603\AppData\Local\Temp\pip-install-z809vh8z\h5pyviewer\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\26603\AppData\Local\Temp\pip-install-z809vh8z\h5pyviewer\setup.py", line 82
print ':'+ver+':'+gitcmt+':'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(':'+ver+':'+gitcmt+':')?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
解决:python2版本的print是没有括号的,例如print x即可,且整数型数字前不能加0,例如x=0256不可以,要把0删掉。
而python3是python(x)
6.安装pycocotools==2.0时
ERROR: Command errored out with exit status 1:
command: 'D:\sf\Anaconda3\envs\imageflow_python27\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\26603\\appdata\\local\\temp\\pip-install-bu2nsq\\pycocotools\\setup.py'"'"'; __file__='"'"'c:\\users\\26603\\appdata\\local\\temp\\pip-install-bu2nsq\\pycocotools\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'c:\users\26603\appdata\local\temp\pip-install-bu2nsq\pycocotools\pip-egg-info'
cwd: c:\users\26603\appdata\local\temp\pip-install-bu2nsq\pycocotools\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\26603\appdata\local\temp\pip-install-bu2nsq\pycocotools\setup.py", line 2, in <module>
from Cython.Build import cythonize
ImportError: No module named Cython.Build
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
解决:原本以为Cython_Build也需要pip install,但其并不是一个库,看样子应该是Cython内的一个子类别。使用pip show看一下自己的Cython有没有pip,pip成功了即可。——在这里我遇到了我pip install Cython显示succesfully,但是pip show Cython却说没有安装这个库,我重复了几次pip install就成功pip show了。
8.安装skimage
https://blog.csdn.net/weixin_36670529/article/details/111245842文章来源:https://www.toymoban.com/news/detail-459107.html
安装到这里,突然发现windows的python2.7不支持tensorflow…
查看anaconda里自己的虚拟环境的python版本
python --version文章来源地址https://www.toymoban.com/news/detail-459107.html
到了这里,关于使用anaconda如何安装opencv、os、PIL、skimage等的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!