Tag Archives: python3.6

[Solved] Win10 Install pyav Error: ERROR: Failed building wheel for avFailed to build av. ERROR: Could not build wheel

Python3. 6: In win10 environment, use the following command to install pyav:

pip install av

Failed to install pyav, here is the error message:

        ERROR: Failed building wheel for av
        Failed to build av
        ERROR: Could not build wheels for av which use PEP 517 and cannot be installed directly:

 

(C:\Users\Jayce\Anaconda3\envs\tf1.7) E:\Code\Python>pip install av
Looking in indexes: https://pypi.doubanio.com/simple
Collecting av
  Downloading https://pypi.doubanio.com/packages/00/3f/9fe21065912902a7856a69df334a67b73a51da5e08ff033fd79f15d05764/av-9.1.1.tar.gz (2.4 MB)
     |████████████████████████████████| 2.4 MB 3.2 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: av
  Building wheel for av (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Jayce\Anaconda3\envs\tf1.7\python.exe' 'C:\Users\Jayce\Anaconda3\envs\tf1.7\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\J
ayce\AppData\Local\Temp\tmpctqsnqx6'
       cwd: C:\Users\Jayce\AppData\Local\Temp\pip-install-hi4s2fdw\av_03c9287622cf4da7918135c5be424e7b
  Complete output (38 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\av
  copying av\about.py -> build\lib.win-amd64-3.6\av
  copying av\datasets.py -> build\lib.win-amd64-3.6\av
  copying av\deprecation.py -> build\lib.win-amd64-3.6\av
  copying av\__init__.py -> build\lib.win-amd64-3.6\av
  copying av\__main__.py -> build\lib.win-amd64-3.6\av
  creating build\lib.win-amd64-3.6\av\audio
  copying av\audio\__init__.py -> build\lib.win-amd64-3.6\av\audio
  creating build\lib.win-amd64-3.6\av\codec
  copying av\codec\__init__.py -> build\lib.win-amd64-3.6\av\codec
  creating build\lib.win-amd64-3.6\av\container
  copying av\container\__init__.py -> build\lib.win-amd64-3.6\av\container
  creating build\lib.win-amd64-3.6\av\data
  copying av\data\__init__.py -> build\lib.win-amd64-3.6\av\data
  creating build\lib.win-amd64-3.6\av\filter
  copying av\filter\__init__.py -> build\lib.win-amd64-3.6\av\filter
  creating build\lib.win-amd64-3.6\av\sidedata
  copying av\sidedata\__init__.py -> build\lib.win-amd64-3.6\av\sidedata
  creating build\lib.win-amd64-3.6\av\subtitles
  copying av\subtitles\__init__.py -> build\lib.win-amd64-3.6\av\subtitles
  creating build\lib.win-amd64-3.6\av\video
  copying av\video\__init__.py -> build\lib.win-amd64-3.6\av\video
  running build_ext
  building 'av.buffer' extension
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  creating build\temp.win-amd64-3.6\Release\src
  creating build\temp.win-amd64-3.6\Release\src\av
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c logo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Jayce\Anaconda3\envs\tf1.7\include -IC:\Users\Jayce\Anaconda
3\envs\tf1.7\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Wi
ndows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcsrc\av\buffer.c /Fobuild\temp.win-amd6
4-3.6\Release\src\av\buffer.obj
  buffer.c
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe logo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\Jayce\Anaconda3
\envs\tf1.7\libs /LIBPATH:C:\Users\Jayce\Anaconda3\envs\tf1.7\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\
Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" avformat.lib avcodec.lib avdevice.lib avutil.lib avfilter.lib swscale.li
b swresample.lib /EXPORT:PyInit_buffer build\temp.win-amd64-3.6\Release\src\av\buffer.obj /OUT:build\lib.win-amd64-3.6\av\buffer.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Rele
ase\src\av\buffer.cp36-win_amd64.lib
  LINK : fatal error LNK1181: cannot open input file 'avformat.lib'
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1181
  ----------------------------------------
  ERROR: Failed building wheel for av
Failed to build av
ERROR: Could not build wheels for av which use PEP 517 and cannot be installed directly

This is because installing without a version number will install the latest version of pyav, which is not suitable for Python 3 6, so you need to compile it yourself, and you need to install ffmpeg for your own compilation, which leads to compilation errors because there is no ffmpeg.

1. Either install ffmpeg by yourself and compile it;

2. Or go straight to find the whl file of Python 3.6, direct installation;

I directly found the latest support for Python 3 on the mirror website Pyav of 6 is 8.0.3. Download and install:

Or add the version number of Python 3.6 in the PIP command:

pip install av==8.0.3

Error: Microsoft Visual C + + 14.0 is required. Get it with “Microsoft Visual C”++

The error is as follows:

error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”: https://visualstudio.microsoft.com/downloads/

    —————————————-
Command “e:\soft\python3.6_ x64\ python.exe -u -c “import setuptools, tokenize;__ file__ =’C:\\Users\\RJ-TR19\\AppData\\Local\\Temp\\pip-build-q2fmqstd\\pycrypto\\ 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\RJ-TR19\AppData\Local\Temp\pip-dchg89ka-record\install- record.txt —
single-version-externally-managed –compile” failed with error code 1 in C:\Users\RJ-TR19\AppData\Local\Temp\pip-build-q2fmqstd\pycrypto\

The last pycrypto instruction is missing the package and needs to be installed

Method 1: choose according to the situation. This method is not very recommended. Otherwise, you have to download a file to install every time you can’t run into it

1. Download pycrypto-2.6.1-cp36-cp36m-win_ Amd64.whl file (the file is currently backed up in your own system)

Copy the file to the local Python installation package e:// soft/Python 3.6_ Then open the CMD window in the scripts directory and run the

pip install pycryptosat‑0.2.0‑cp36‑cp36m‑win_amd64.whl

2. Access to other plug-ins https://www.lfd.uci.edu/~gohlke/pythonlibs/ Search inside to find the version, install the same way

Download Microsoft Visual C + + 14.0

Choose the default way to install, the computer does not need to restart, directly PIP install the required plug-ins on the line

Address: https://download.csdn.net/download/weixin_ 41996632/12264862

Anaconda returns Python 3.7 to Python 3.6

Windows10 system installs tensorflow-gpu (CUDA Toolkit, CUDNN) under anaconda
A recent download of TensorFlow provided the following: Could not find a version that front-end the requirements tensorflow

After a bit of research, it turned out that Python 3.7 was not supported by TensorFlow in 2019, so I was forced to revert back to 3.6, which was a simple step. You open the Anaconda Prompt, type Conda Install Python =3.6, wait for a prompt (y/n), type y, wait for a few minutes, and the prompt done will indicate that Python 3.7 has fallen back to Python 3.6.


— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — line — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
August 15, 2020
Some netizens left comments or chatted with me that this method was not successful. Through communication, I learned that many people actually did not use domestic mirror images. So we need to add domestic images first.
Conda source changes:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --set show_channel_urls yes

The PIP source:
Add parameters after PIP -i https://pypi.tuna.tsinghua.edu.cn/simple
example: PIP install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas
In fact, many laptops have Gpus (I was cheated by someone before that the LAPTOP GPU does not support tensorFlow-GPU, ha ha ha), you can check my new blog to see if your computer supports GPU, and then install the GPU version, because the acceleration of the GPU version of TensorFlow is very obvious. Windows10 system installs tensorflow-gpu (CUDA Toolkit, CUDNN) under anaconda
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- line -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 

How to solve oserror: [errno 98] address already in use and kill the python3 process

[root@localhost appp_dai]# python3 run_app.py

Traceback (most recent call last):

File “run_app.py”, line 33, in < module>

app. The run (debug = True, the host = ‘0.0.0.0’, the port = 5000)

the File “/ usr/local/python3/lib/python3.6/site – packages/flask/app. Py”, line 841, in the run

run_simple(host, port, self, **options)

the File “/ usr/local/python3/lib/python3.6/site – packages/werkzeug/serving. Py”, line 795, in run_simple

s.b ind (get_sockaddr (hostname, port, address_family))

OSError: [Errno 98] Address already in use

[root@localhost appp_dai]#
ps -elf|grep 500

4 S root 14674 14513 0 80 0-47537 futex_ April 02?00:00:00/usr/libexec/docker/docker – proxy – current proto TCP – host – IP 0.0.0.0 – host – port 50070 – container – IP 172.17.0.2 – container – port 50070

0 S root 17743 1076 0 80 0-28170 pipe_w 18:34 PTS /0 00:00:00 grep –color=auto 500

[root @ localhost appp_dai] #

[root@localhost appp_dai]#
net

netreport netstat

[root@localhost appp_dai]#
netstat -tlnp|grep 5000

TCP 0 0 0.0.0.0:5000 0.0.0.0: * LISTEN 2345/python

[root@localhost appp_dai]#
kill -9 2345

[root@localhost appp_dai]#
netstat -tlnp|grep 5000

[1]+ python run_app.py killed

View all ongoing processes on the machine

[root@localhost appp_dai]# ps -elf|grep 500

View the native 5000 port process

[root@localhost appp_dai]# netstat -tlnp|grep 5000

Reason: Close the IDE without stopping the project.  

Or the previous project did not stop and the project was run again.  

Solution: The former is simple and kills the process. The latter is easier to stop a project that is running.  

The order to kill the process (a little insulting to everyone’s intelligence, but to add) :

lsof -i :
5000

This command is for the hostport5000 I am using. Please change it by yourself.

1

If you are viewing all ongoing processes on the machine:

ps aux
# See all processes with PS-A

1

Kill process:

kill

9
PID
# PID is the process number, which is displayed when viewing a process, such as 23645