Install TensorFlow Object Detection on Windows Problems - python

I am trying to install Tensor Flow Object Detection on Windows 10.
Resource: https://towardsdatascience.com/how-to-install-tensorflow-2-object-detection-api-on-windows-2eef9b7ae869
After running these steps, we are receiving the errors below. It is stalling on pyarrow.
How can this be fixed?
protoc object_detection/protos/*.proto --python_out=.
python -m pip install .
Error: Collecting pyarrow<3.0.0,>=0.15.1
Using cached pyarrow-2.0.0.tar.gz (58.9 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\joe.k.smith\AppData\Local\Programs\Python\Python39\python.exe' 'C:\Users\joe.k.smith\AppData\Local\Programs\Python\Python39\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\joe.k.smith\AppData\Local\Temp\pip-build-env-b29td69q\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cython >= 0.29' 'numpy==1.14.5; python_version<'"'"'3.7'"'"'' 'numpy==1.16.0; python_version>='"'"'3.7'"'"'' setuptools setuptools_scm wheel
cwd: None
Complete output (1950 lines):
Ignoring numpy: markers 'python_version < "3.7"' don't match your environment
Collecting cython>=0.29
Using cached Cython-0.29.23-cp39-cp39-win_amd64.whl (1.7 MB)
Collecting numpy==1.16.0
Additional Resources:
https://medium.com/riow/tensorflow-object-detection-on-windows-ad10bfde217c

I'm not exactly sure about that error, but for Tensorflow in general, if you go to this page, you'll see that, as of this writing, the only supported version of python are 3.6 - 3.8. It sounds like for tensorflow/models, you might do well to use 3.7. You will want to make sure you have a compatible version of pip as well.

Related

Error installing pandas for python 3.7.12

Context:
I am using the brand new MacBook pro with M1 pro, it has macOS Monterey 12.0 it is only has a week old.
I installed pyenv with brew and then I installed version 3.7.12, I wanted to create a venv and install pandas inside it but by mistake, I started to install it on the pyenv of the 3.7.12 without the venv created. When it was executing the installation and I realized I pressed Command + C and stopped.
After that, I created the venv "cosa5" and try to install it but it showed me the following error:
(cosa5) matiasnavarrete#MacBook-Pro-de-Matias codetest % pip install pandas
Collecting pandas
Using cached pandas-1.3.4.tar.gz (4.7 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: /Users/matiasnavarrete/Desktop/codetest/cosa5/bin/python /Users/matiasnavarrete/Desktop/codetest/cosa5/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/4p/syttjfhj7896l__s3gtxnxkm0000gn/T/pip-build-env-44pq47ee/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=51.0.0' wheel 'Cython>=0.29.24,<3' 'oldest-supported-numpy>=0.10'
cwd: None
Complete output (29 lines):
Collecting setuptools>=51.0.0
Using cached setuptools-59.4.0-py3-none-any.whl (952 kB)
Collecting wheel
Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Collecting Cython<3,>=0.29.24
Using cached Cython-0.29.24-py2.py3-none-any.whl (979 kB)
Collecting oldest-supported-numpy>=0.10
Using cached oldest_supported_numpy-0.12-py3-none-any.whl (3.8 kB)
Collecting numpy==1.14.5; python_version == "3.7" and platform_machine != "aarch64" and platform_system != "AIX" and platform_python_implementation != "PyPy"
Using cached numpy-1.14.5.zip (4.9 MB)
ERROR: Command errored out with exit status 1:
command: /Users/matiasnavarrete/Desktop/codetest/cosa5/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4p/syttjfhj7896l__s3gtxnxkm0000gn/T/pip-install-r3mgeudj/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/4p/syttjfhj7896l__s3gtxnxkm0000gn/T/pip-install-r3mgeudj/numpy/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 /private/var/folders/4p/syttjfhj7896l__s3gtxnxkm0000gn/T/pip-pip-egg-info-h4uqe4mm
cwd: /private/var/folders/4p/syttjfhj7896l__s3gtxnxkm0000gn/T/pip-install-r3mgeudj/numpy/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/matiasnavarrete/Desktop/codetest/cosa5/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
from setuptools.dist import Distribution
File "/Users/matiasnavarrete/Desktop/codetest/cosa5/lib/python3.7/site-packages/setuptools/dist.py", line 34, in <module>
from setuptools import windows_support
File "/Users/matiasnavarrete/Desktop/codetest/cosa5/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/Users/matiasnavarrete/.pyenv/versions/3.7.12/lib/python3.7/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 21.3.1 is available.
You should consider upgrading via the '/Users/matiasnavarrete/Desktop/codetest/cosa5/bin/python -m pip install --upgrade pip' command.
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/matiasnavarrete/Desktop/codetest/cosa5/bin/python /Users/matiasnavarrete/Desktop/codetest/cosa5/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/4p/syttjfhj7896l__s3gtxnxkm0000gn/T/pip-build-env-44pq47ee/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=51.0.0' wheel 'Cython>=0.29.24,<3' 'oldest-supported-numpy>=0.10' Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 21.3.1 is available.
You should consider upgrading via the '/Users/matiasnavarrete/Desktop/codetest/cosa5/bin/python -m pip install --upgrade pip' command.
I don't know if the fact that I stopped it is related to the bug or not, but I mentioned it anyway.
Tried uninstalling 3.7.12 from pyenv, installing it again, creating a new venv but it keeps showing the same error.
After this I installed 3.9.9, I created the venv and I installed pandas and I had no problem with that version. It is 3.7.12 that keeps giving me problems.
Question:
How can I fix it?

pip cannot find build dependencies

I am trying to install some python libraries using
pip install -r requirements
The file looks like:
spacy>=2.1.0,<2.2.0
matplotlib
pandas
networkx
flask
inflect
It was initially giving errors for C++ build tools, but after installing those using the visual studio installer I get the following error.
Collecting spacy<2.2.0,>=2.1.0
Using cached spacy-2.1.9.tar.gz (30.7 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\haris\AppData\Local\Programs\Python\Python38\python.exe'
'C:\Users\haris\AppData\Local\Temp\pip-standalone-pip-iges9uxt\__env_pip__.zip\pip' install --ignore-installed --no-user --prefix
'C:\Users\haris\AppData\Local\Temp\pip-build-env-49g1awc5\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
ERROR: Failed building wheel for blis
Running setup.py clean for blis
Successfully built preshed
Failed to build blis
Do I need to reinstall a newer version of python?

pip install pymsgbox offline always failed

I need to publish my python app on windows with offline install, but it fails when install pymsgbox:
c:\Users\admin\Desktop\python3\pip>pip3.6 install --no-index --find-links=.\ pymsgbox==1.0.9
Looking in links: .
Collecting pymsgbox==1.0.9
Installing build dependencies ... error
Complete output from command "c:\program files\python36\python.exe" -m pip install --ignore-installed --no-user --prefix C:\Users\admin\AppData\Local\Temp\pip-build-env-gahbccbj --no-warn-script-location --no-binary :none: --only-binary :none: --no-index --find-links .\ -- setuptools>=38.2.5 wheel:
Looking in links: .
Collecting setuptools>=38.2.5
Collecting wheel
Could not find a version that satisfies the requirement wheel (from versions: )
No matching distribution found for wheel
Command ""c:\program files\python36\python.exe" -m pip install --ignore-installed --no-user --prefix C:\Users\admin\AppData\Local\Temp\pip-build-env-gahbccbj --no-warn-script-location --no-binary :none: --only-binary :none: --no-index --find-links .\ -- setuptools>=38.2.5 wheel" failed with error code 1 in None
I have already install setuptools>=38.2.5
c:\Users\admin\Desktop\python3\pip>pip3.6 list | findstr setuptools
setuptools 42.0.2
If I install pymsgbox online, it success:
c:\Users\admin\Desktop\python3\pip>pip3.6 install pymsgbox==1.0.9 -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pymsgbox==1.0.9
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7d/ff/4c6f31a4f08979f12a663f2aeb6c8b765d3bd592e66eaaac445f547bb875/PyMsgBox-1.0.9.tar.gz
Installing build dependencies ... done
Installing collected packages: pymsgbox
Running setup.py install for pymsgbox ... done
Successfully installed pymsgbox-1.0.9
Why it requires setuptools while already satisfied?

Error in cmd whlie installing CPPYY on windows

I have been trying to install Cppyy on my computerbut I'm new to this so I don't know a whole lot about this I have python and pip install on my computer
C:\WINDOWS\system32>python --version
Python 3.8.6
C:\WINDOWS\system32> pip --version
pip 20.2.3
when I try to run
pip install cppyy
cmd gives me error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\sarfaraz\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' 'C:\Users\sarfaraz\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\sarfaraz\AppData\Local\Temp\pip-build-env-z4gw8trb\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'CPyCppyy==1.11.4; python_implementation != '"'"'PyPy'"'"'' 'cppyy-backend==1.14.0; python_implementation != '"'"'PyPy'"'"'' 'cppyy-cling==6.21.3; python_implementation != '"'"'PyPy'"'"'' 'cppyy-cling<=6.18.2.3; python_implementation == '"'"'PyPy'"'"'' setuptools wheel
cwd: None
Complete output (42 lines):
Ignoring cppyy-cling: markers 'platform_python_implementation == "PyPy"' don't match your environment
Collecting CPyCppyy==1.11.4
Using cached CPyCppyy-1.11.4.tar.gz (178 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\sarfaraz\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' 'C:\Users\sarfaraz\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\sarfaraz\AppData\Local\Temp\pip-build-env-hj42_3n3\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cppyy-cling>=6.21.3' 'cppyy-backend>=1.14' setuptools wheel
cwd: None
Complete output (31 lines):
Collecting cppyy-cling>=6.21.3
Using cached cppyy_cling-6.21.3-py2.py3-none-win_amd64.whl (18.2 MB)
Collecting cppyy-backend>=1.14
Using cached cppyy-backend-1.14.0.tar.gz (32 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
Collecting setuptools
Using cached setuptools-50.3.0-py3-none-any.whl (785 kB)
Collecting wheel
Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
Building wheels for collected packages: cppyy-backend
Building wheel for cppyy-backend (PEP 517): started
Building wheel for cppyy-backend (PEP 517): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\sarfaraz\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' 'C:\Users\sarfaraz\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\sarfaraz\AppData\Local\Temp\tmpojxb8d41'
cwd: C:\Users\sarfaraz\AppData\Local\Temp\pip-install-znkz3pmg\cppyy-backend
Complete output (6 lines):
running bdist_wheel
running build
running build_ext
checking for build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release
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 cppyy-backend
Failed to build cppyy-backend
ERROR: Could not build wheels for cppyy-backend which use PEP 517 and cannot be installed directly
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\sarfaraz\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' 'C:\Users\sarfaraz\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\sarfaraz\AppData\Local\Temp\pip-build-env-hj42_3n3\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cppyy-cling>=6.21.3' 'cppyy-backend>=1.14' setuptools wheel Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\sarfaraz\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' 'C:\Users\sarfaraz\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\sarfaraz\AppData\Local\Temp\pip-build-env-z4gw8trb\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'CPyCppyy==1.11.4; python_implementation != '"'"'PyPy'"'"'' 'cppyy-backend==1.14.0; python_implementation != '"'"'PyPy'"'"'' 'cppyy-cling==6.21.3; python_implementation != '"'"'PyPy'"'"'' 'cppyy-cling<=6.18.2.3; python_implementation == '"'"'PyPy'"'"'' setuptools wheel Check the logs for full command output.
I found some instruction on the site but it was hard for me to follow it since I'm new to this stuff
Thanks in advance
Try to upgrade setuptools wheel
pip install -U setuptools wheel
End then try
pip install cppyy --no-index
If not help, that problem may by with python 3.8
By PyPi it’s supported <=3.7
As shown in the error message and mentioned already by hoefling, you need a system compiler, at the very minimum for system headers, but also for C++ library headers. Cling needs the code from these headers to parse any new C++ code you may give it that uses C++ standard library or Windows system features.
In principle, it's possible to ship a precompiled header with cppyy-cling that contains all system and C++ headers as IR bitcode, but MSVC likes to change header include guards between versions, so that would then only work if there is no system compiler. (It's somewhat better on Linux, but it, too, has changed include guard names in some instances.) This will be revisited once Cling supports precompiled modules (PCMs; as opposed to headers) on Windows. Then these PCMs can be prepackaged and installed conditionally if no system compiler is available. Module support in upstream is, however, still very fresh and not even released yet, so this is something that will only appear in the medium-term.
Anyway, MSVC is free these days. :)

How do I sucessfully install python-telegram-bot into Termux?

I have a problem. I made a simple web scraping telegram bot and I want it to run on my old phone. However, I am not able to install python-telegram-bot via pip. I get this weird error message. Does anyone know how do I tackle this issue? Thank you
> $ pip install python-telegram-bot Collecting python-telegram-bot
> Using cached
> https://files.pythonhosted.org/packages/84/6c/47932a4041ee76650ad1f45a80e1422077e1e99c08a4d7a61cfbe5393d41/python_telegram_bot-11.1.0-py2.py3-none-any.whl
> Collecting future>=0.16.0 (from python-telegram-bot) Using cached
> https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz
> Collecting certifi (from python-telegram-bot) Using cached
> https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655/certifi-2018.10.15-py2.py3-none-any.whl
> Collecting cryptography (from python-telegram-bot) Using cached
> https://files.pythonhosted.org/packages/f3/39/d3904df7c56f8654691c4ae1bdb270c1c9220d6da79bd3b1fbad91afd0e1/cryptography-2.4.2.tar.gz
> Installing build dependencies ... error Complete output from command
> /data/data/com.termux/files/usr/bin/python -m pip install
> --ignore-installed --no-user --prefix /data/data/com.termux/files/usr/tmp/pip-build-env-cvyz6a4p
> --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=18.5 wheel "cffi>=1.7,!=1.11.3;
> python_implementation != 'PyPy'": Collecting setuptools>=18.5
> Using cached https://files.pythonhosted.org/packages/e7/16/da8cb8046149d50940c6110310983abb359bbb8cbc3539e6bef95c29428a/setuptools-40.6.2-py2.py3-none-any.whl
> Collecting wheel
> Using cached https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
> Collecting cffi!=1.11.3,>=1.7
> Using cached https://files.pythonhosted.org/packages/e7/a7/4cd50e57cc6f436f1cc3a7e8fa700ff9b8b4d471620629074913e3735fb2/cffi-1.11.5.tar.gz
> Complete output from command python setup.py egg_info:
>
> No working compiler found, or bogus compiler options passed to
> the compiler from Python's standard "distutils" module. See
> the error messages above. Likely, the problem is not related
> to CFFI but generic to the setup.py of any Python package that
> tries to compile C code. (Hints: on OS/X 10.8, for errors about
> -mno-fused-madd see http://stackoverflow.com/questions/22313407/
> Otherwise, see https://wiki.python.org/moin/CompLangPython or
> the IRC channel #python on irc.freenode.net.)
>
> ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in
> /data/data/com.termux/files/usr/tmp/pip-install-kqmk4olx/cffi/
>
> ---------------------------------------- Command
> "/data/data/com.termux/files/usr/bin/python -m pip install
> --ignore-installed --no-user --prefix /data/data/com.termux/files/usr/tmp/pip-build-env-cvyz6a4p
> --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=18.5 wheel "cffi>=1.7,!=1.11.3;
> python_implementation != 'PyPy'"" failed with error code 1 in None $
You have to have development toolchain (a compiler and all that) for Termux. By default you can install clang:
pkg install clang python-dev
You can also try gcc, see
https://android.stackexchange.com/a/186223
and
https://wiki.termux.com/wiki/Package_Management#Community_repositories

Categories

Resources