Installing tf-models-official on Windows 10 - tensorflow

I'm trying to install tf-models-official on a PC with Windows 10.
When I run pip install tf-models-official on the command prompt, I get the following error
Building wheel for pycocotools (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\iavta\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\iavta\\AppData\\Local\\Temp\\pip-install-0twx2hmy\\pycocotools_ebdc747cefa04c81a8aab51eebf9fe53\\setup.py'"'"'; __file__='"'"'C:\\Users\\iavta\\AppData\\Local\\Temp\\pip-install-0twx2hmy\\pycocotools_ebdc747cefa04c81a8aab51eebf9fe53\\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\iavta\AppData\Local\Temp\pip-wheel-60i3880o'
cwd: C:\Users\iavta\AppData\Local\Temp\pip-install-0twx2hmy\pycocotools_ebdc747cefa04c81a8aab51eebf9fe53\
Complete output (16 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.8\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.8\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.8\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-3.8\pycocotools
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools\_mask.c
C:\Users\iavta\anaconda3\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\iavta\AppData\Local\Temp\pip-install-0twx2hmy\pycocotools_ebdc747cefa04c81a8aab51eebf9fe53\pycocotools\_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'pycocotools._mask' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for pycocotools
Running setup.py clean for pycocotools
Successfully built termcolor
Failed to build pycocotools
I've already done pip install pycocotools-windows and I had no problems whatsoever during installation, and according to Vision Studio Installer, I have Visual Studio 2019 version 16.11.3 already installed. So, I have no idea why they ask me for Microsoft Visual C++ 14.0 or greater.

I solved the annoying "failed building wheel for pycocotools" issue on windows 10 anaconda (python=3.9) by:
Uninstall Visual Studio 2019;
Uninstall all Visual C++ Redistributable (2015-2019, 2013, 2012, etc.);
Install Visual Studio 2022, and tick Desktop development with C++.
Activate the new virtual environment, and run "pip install tf-models-official".

Related

Pipx can not build packages when trying to install eth-brownie

I got a following error code while trying to install brownie through pipx (by typing "pipx install eth-brownie)
PS C:\Users\J.M\demos\brownie_simple_storage> pipx install eth-brownie
Fatal error from pip prevented installation. Full pip output in file:
C:\Users\J.M\.local\pipx\logs\cmd_2023-01-08_01.26.02_pip_errors.log
pip failed to build packages:
bitarray
cytoolz
lru-dict
multidict
psutil
regex
yarl
Some possibly relevant errors from pip install:
error: subprocess-exited-with-error
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Error installing eth-brownie.
PS C:\Users\J.M\demos\brownie_simple_storage>
I have all the prerequirements (node.js, recent python version, ganache cli, npm all successfully installed), I really have no idea why it can't build those packages.

error when i run "pip install chatterbot"

when i run the comman pip install chatterbot i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work too
ERROR: Command errored out with exit status 1:
command: 'c:\users\sebas\appdata\local\programs\python\python39\python.exe' 'c:\users\sebas\appdata\local\programs\python\python39\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Sebas\AppData\Local\Temp\pip-build-env-apehx1f6\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0,<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=7.0.8,<7.1.0'
cwd: None
Complete output (75 lines):
Collecting setuptools
Using cached setuptools-50.3.0-py3-none-any.whl (785 kB)
Collecting wheel<0.33.0,>0.32.0
Using cached wheel-0.32.3-py2.py3-none-any.whl (21 kB)
Collecting Cython
Using cached Cython-0.29.21-py2.py3-none-any.whl (974 kB)
Collecting cymem<2.1.0,>=2.0.2
Using cached cymem-2.0.3.tar.gz (51 kB)
Collecting preshed<2.1.0,>=2.0.1
Using cached preshed-2.0.1.tar.gz (113 kB)
Collecting murmurhash<1.1.0,>=0.28.0
Using cached murmurhash-1.0.2.tar.gz (35 kB)
Collecting thinc<7.1.0,>=7.0.8
Using cached thinc-7.0.8.tar.gz (1.9 MB)
Collecting blis<0.3.0,>=0.2.1
Using cached blis-0.2.4.tar.gz (1.5 MB)
Collecting wasabi<1.1.0,>=0.0.9
Using cached wasabi-0.8.0-py3-none-any.whl (23 kB)
Collecting srsly<1.1.0,>=0.0.6
Using cached srsly-1.0.2.tar.gz (192 kB)
Processing c:\users\sebas\appdata\local\pip\cache\wheels\a3\17\dd\f2dba23a35bb6008732772ccfb13d3d0e537fbc6919ce6862b\numpy-1.19.2-cp39-cp39-win_amd64.whl
Collecting plac<1.0.0,>=0.9.6
Using cached plac-0.9.6-py2.py3-none-any.whl (20 kB)
Collecting tqdm<5.0.0,>=4.10.0
Using cached tqdm-4.50.2-py2.py3-none-any.whl (70 kB)
Using legacy 'setup.py install' for cymem, since package 'wheel' is not installed.
Using legacy 'setup.py install' for preshed, since package 'wheel' is not installed.
Using legacy 'setup.py install' for murmurhash, since package 'wheel' is not installed.
Using legacy 'setup.py install' for thinc, since package 'wheel' is not installed.
Using legacy 'setup.py install' for blis, since package 'wheel' is not installed.
Using legacy 'setup.py install' for srsly, since package 'wheel' is not installed.
Installing collected packages: setuptools, wheel, Cython, cymem, preshed, murmurhash, numpy, blis, wasabi, srsly, plac, tqdm, thinc
Running setup.py install for cymem: started
Running setup.py install for cymem: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'c:\users\sebas\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Sebas\\AppData\\Local\\Temp\\pip-install-px5vncs8\\cymem\\setup.py'"'"'; __file__='"'"'C:\\Users\\Sebas\\AppData\\Local\\Temp\\pip-install-px5vncs8\\cymem\\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\Sebas\AppData\Local\Temp\pip-record-1249wihi\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\Sebas\AppData\Local\Temp\pip-build-env-apehx1f6\overlay' --compile --install-headers 'C:\Users\Sebas\AppData\Local\Temp\pip-build-env-apehx1f6\overlay\Include\cymem'
cwd: C:\Users\Sebas\AppData\Local\Temp\pip-install-px5vncs8\cymem\
Complete output (35 lines):
WARNING: The wheel package is not available.
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\cymem
copying cymem\about.py -> build\lib.win-amd64-3.9\cymem
copying cymem\__init__.py -> build\lib.win-amd64-3.9\cymem
package init file 'cymem\tests\__init__.py' not found (or not a regular file)
creating build\lib.win-amd64-3.9\cymem\tests
copying cymem\tests\test_import.py -> build\lib.win-amd64-3.9\cymem\tests
copying cymem\cymem.pyx -> build\lib.win-amd64-3.9\cymem
copying cymem\cymem.pxd -> build\lib.win-amd64-3.9\cymem
copying cymem\__init__.pxd -> build\lib.win-amd64-3.9\cymem
running build_ext
building 'cymem.cymem' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\cymem
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\sebas\appdata\local\programs\python\python39\include -Ic:\users\sebas\appdata\local\programs\python\python39\include -Ic:\users\sebas\appdata\local\programs\python\python39\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)\Windows 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 /EHsc /Tpcymem/cymem.cpp /Fobuild\temp.win-amd64-3.9\Release\cymem/cymem.obj /Ox /EHsc
cymem.cpp
cymem/cymem.cpp(4501): error C2039: 'tp_print': is not a member of '_typeobject'
c:\users\sebas\appdata\local\programs\python\python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
cymem/cymem.cpp(4509): error C2039: 'tp_print': is not a member of '_typeobject'
c:\users\sebas\appdata\local\programs\python\python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
cymem/cymem.cpp(4519): error C2039: 'tp_print': is not a member of '_typeobject'
c:\users\sebas\appdata\local\programs\python\python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
cymem/cymem.cpp(4525): error C2039: 'tp_print': is not a member of '_typeobject'
c:\users\sebas\appdata\local\programs\python\python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
cymem/cymem.cpp(4969): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
c:\users\sebas\appdata\local\programs\python\python39\include\cpython/unicodeobject.h(446): note: see declaration of '_PyUnicode_get_wstr_length'
cymem/cymem.cpp(4985): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
c:\users\sebas\appdata\local\programs\python\python39\include\cpython/unicodeobject.h(446): note: see declaration of '_PyUnicode_get_wstr_length'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\sebas\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Sebas\\AppData\\Local\\Temp\\pip-install-px5vncs8\\cymem\\setup.py'"'"'; __file__='"'"'C:\\Users\\Sebas\\AppData\\Local\\Temp\\pip-install-px5vncs8\\cymem\\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\Sebas\AppData\Local\Temp\pip-record-1249wihi\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\Sebas\AppData\Local\Temp\pip-build-env-apehx1f6\overlay' --compile --install-headers 'C:\Users\Sebas\AppData\Local\Temp\pip-build-env-apehx1f6\overlay\Include\cymem' Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\sebas\appdata\local\programs\python\python39\python.exe' 'c:\users\sebas\appdata\local\programs\python\python39\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Sebas\AppData\Local\Temp\pip-build-env-apehx1f6\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0,<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=7.0.8,<7.1.0' Check the logs for full command output.```
IGNORE THIS BELOW
when i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work toowhen i run the comman ```pip install chatterbot``` i got this issue and dont install :c i try adding the building tools and visual c++ 14.0 and didn work too
Downgrade to Python 3.8 - it's too soon for Python 3.9 (for chatterbox).

Unable to install Pandas in Python 3.4

I am trying to install Pandas module in Python version 3.4 (for Windows XP support). However, I am getting following error:
UPDATING build\lib.win32-3.4\pandas/_version.py
set build\lib.win32-3.4\pandas/_version.py to '0.22.0'
running build_ext
building 'pandas._libs.tslibs.strptime' extension
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
----------------------------------------
Command "C:\Python34\python.exe -u -c "import setuptools, tokenize;
__file__='C:\\users\\cardio\\Temp\\pip-build-5xhz4ymf\\pandas\\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\cardio\Temp\pip-prngb6r2-record\install-record.txt
--single-version-externally-managed --compile"
failed with error code 1 in C:\users\cardio\Temp\pip-build-5xhz4ymf\pandas\
How can this problem be solved?

Tensorflow Custom Compile on Windows

So, I've installed Bazel via Chocolatey, installed Python 3.5 and 2.7, installed CUDA v8, and cuDNN v6, and installed JDK 8.0, I'm now trying to custom-build TensorFlow on my Windows 10 device, with AVX, AVX 2 and CUDA. TensorFlow-GPU, the pre-built version, does work, I've already tested and run that successfully.
I've followed the instructions of other articles, both on TensorFlows' actual site (trying to adapt some sections from the Linux/Mac installs), and on here. The furthest I've made it is; cloning the Github repository via Msys2, running configure.py, then attempting to build via bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package I receive an error, the header of which is:
Error reading java.io.IOException: CreateProcess(): The system cannot find the file specified.
: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include/cudnn.h
I've double checked, that file does exist, so I'm not sure why I'm getting this error.
EDIT: Also attempted to run via Powershell, reached the same point.
Any help would be much appreciated.
I had the exact same error while trying to build Tensorflow on Windows (using cuDNN 5.1). I fixed it by launching bazel from the msys2 terminal (instead of from the windows command prompt) and manually setting the BAZEL_SH environment variable before attempting to build.
export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
bazel build -c opt --config=win-cuda tensorflow/cc:cc_ops
The following steps helped me to compile Tensorflow on Windows 10.
pacman -Syuu patch
ln -s "c:\python27\python.exe" /usr/bin/python
export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
"C:\Documents and Settings\All Users\chocolatey\bin\bazel.exe" build --config=opt --config=win-cuda //tensorflow/tools/pip_package:build_pip_package
But after 1 hour of compilation I got another error:
C:\tools\msys64\tmp_bazel_dmitry\x1e5egqw\execroot\org_tensorflow\external\protobuf_archive\python\google\protobuf\internal\api_implementation.cc
: fatal error C1083: Cannot open compiler generated file: '': Invalid
argument Target //tensorflow/tools/pip_package:build_pip_package
failed to build

Error installing library of Scrapy in PyCharm

I can install other packages, but can't install Scrapy. I get the following errors:
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'lxml.etree' extension
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
However, C++ is installed, which I installed numerous of times. I have x86 and 64 bit installations (not sure if it's 10.0) but I have 2013-2017 versions installed.
Please upgrade your pip by following command.
python -m pip install --upgrade pip
Then install Scrapy by following command.
pip install Scrapy
download latest twisted package and install with pip.
https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
after that install scrapy
In my case, I found that pywin32 was not installed...
So I did
download the latest Twisted package from https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
You want to use the amd64 if you have Windows 64 (regardless if it's an Intel processor or not)
You can use any browser for the download and copy/paste the file into the project folder of your current pycharm project.
Then in pycharm type this:
pip install Twisted-20.3.0-cp39-cp39-win_amd64.whl
(assuming that your package was Twisted-20.3.0-cp39-cp39-win_amd64.whl)
then proceed with:
pip install Scrapy